如何添加ASP。NET 4.0作为iis7的应用程序池,Windows 7。

时间:2020-12-28 03:35:22

Configuring servers is not my strong suit by any means. I'm trying to move a development project to Windows 7. One of the things that I need to run the application is to select ASP.NET v4.0 as the application pool within IIS.

配置服务器不是我的强项。我想把一个开发项目搬到Windows 7上。运行应用程序需要做的一件事是选择ASP。NET v4.0作为IIS中的应用程序池。

I went through the directions in the following link to make sure that the proper Application Development Options were selected:

我浏览了以下连结的指引,以确保选择了合适的应用程式发展选项:

http://www.gotknowhow.com/articles/how-to-install-iis7-and-enable-aspnet

http://www.gotknowhow.com/articles/how-to-install-iis7-and-enable-aspnet

From within the IIS Manager, I select Application Pools and only see
- Classic .NET AppPool
- DefaultAppPool

在IIS管理器中,我选择应用程序池,只看到- Classic .NET AppPool - DefaultAppPool

I need to also be able to select from
- ASP.NET v4.0
- ASP.NET v4.0 Classic

我还需要能够从- ASP中选择。净v4.0 - ASP。净v4.0经典

How can I add these to the list of available application pools?

如何将它们添加到可用应用程序池列表中?

5 个解决方案

#1


448  

Chances are you need to install .NET 4 (Which will also create a new AppPool for you)

您可能需要安装。net 4(它还将为您创建一个新的AppPool)

First make sure you have IIS installed then perform the following steps:

首先确保安装了IIS,然后执行以下步骤:

  1. Open your command prompt (Windows + R) and type cmd and press ENTER
    You may need to start this as an administrator if you have UAC enabled.
    To do so, locate the exe (usually you can start typing with Start Menu open), right click and select "Run as Administrator"
  2. 打开命令提示符(Windows + R),输入cmd,然后按ENTER键,如果启用了UAC,您可能需要以管理员的身份启动它。为此,找到exe(通常您可以开始输入并打开开始菜单),右键单击并选择“作为管理员运行”
  3. Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press ENTER.
  4. cd型C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 \并按ENTER。
  5. Type aspnet_regiis.exe -ir and press ENTER again.
    • If this is a fresh version of IIS (no other sites running on it) or you're not worried about the hosted sites breaking with a framework change you can use -i instead of -ir. This will change their AppPools for you and steps 5-on shouldn't be necessary.
    • 如果这是IIS的新版本(没有运行在其上的其他站点),或者您不担心托管站点会破坏框架更改,您可以使用-i而不是-ir。这将为您更改他们的apppool,不需要执行5-on步骤。
    • at this point you will see it begin working on installing .NET's framework in to IIS for you
    • 此时,您将看到它开始为您在IIS中安装。net框架
  6. aspnet_regiis类型。exe -ir和按回车键。如果这是IIS的新版本(没有运行在其上的其他站点),或者您不担心托管站点会破坏框架更改,您可以使用-i而不是-ir。这将为您更改他们的apppool,不需要执行5-on步骤。此时,您将看到它开始为您在IIS中安装。net框架
  7. Close the DOS prompt, re-open your start menu and right click Computer and select Manage
  8. 关闭DOS提示符,重新打开开始菜单,右键单击计算机,选择Manage
  9. Expand the left-hand side (Services and Applications) and select Internet Information Services
    • You'll now have a new applet within the content window exclusively for IIS.
    • 现在,您将在content窗口中拥有一个专门用于IIS的新applet。
  10. 展开左边(服务和应用程序)并选择Internet信息服务,您现在将在内容窗口中为IIS提供一个新的applet。
  11. Expand out your computer and locate the Application Pools node, and select it. (You should now see ASP.NET v4.0 listed)
  12. 展开您的计算机并定位应用程序池节点并选择它。(您现在应该看到ASP。净v4.0上市)
  13. Expand out your Sites node and locate the site you want to modify (select it)
  14. 展开站点节点并定位要修改的站点(选择它)
  15. To the right you'll notice Basic Settings... just below the Edit Site text. Click this, and a new window should appear
  16. 在右边你会注意到基本的设置…就在编辑网站文本下面。单击此按钮,将出现一个新窗口
  17. Select the .NET 4 AppPool using the Select... button and click ok.
  18. 使用Select…选择。net 4 AppPool。按钮并单击ok。
  19. Restart the site, and you should be good-to-go.
  20. 重新启动网站,你应该是一个好去处。

(You can repeat steps 7-on for every site you want to apply .NET 4 on as well).

(你也可以在每一个你想要应用。net 4的网站上重复步骤7-on)。


Additional References:

额外的引用:

  1. .NET 4 Framework
    The framework for those that don't already have it.
  2. 。net 4为那些还没有框架的人提供框架。
  3. How do I run a command with elevated privileges?
    Directions on how to run the command prompt with Administrator rights.
  4. 如何使用高级特权运行命令?关于如何使用管理员权限运行命令提示符的说明。
  5. aspnet_regiis.exe options
    For those that might want to know what -ir or -i does (or the difference between them) or what other options are available. (I typically use -ir to prevent any older sites currently running from breaking on a framework change but that's up to you.)
  6. aspnet_regiis。对于那些可能想知道-ir或-i做什么(或它们之间的区别)或其他选项可用的人,exe选项。(我通常使用-ir来防止当前运行的任何旧站点破坏框架更改,但这取决于您。)

#2


15  

In the top level of the IIS Manager (above Sites), you should see the Application Pools tree node. Right click on "Application Pools", choose "Add Application Pool".

在IIS管理器(上面的站点)的顶层,您应该看到应用程序池树节点。右键单击“应用程序池”,选择“添加应用程序池”。

Give it a name, choose .NET Framework 4.0 and either Integrated or Classic mode.

给它起个名字,选择。net Framework 4.0,选择集成模式或经典模式。

When you add or edit a web site, your new application pools will now show up in the list.

当您添加或编辑web站点时,您的新应用程序池将显示在列表中。

#3


14  

Open a windows command line. Switch directories to C:\Windows\Microsoft.Net\Framework\v4.0.xxxx where the x's are the build number. Type aspnet_regiis -ir and hit enter. This should register .Net v4.0 and create the application pools by default. If it doesn't, you will need to create them manually by right-clicking the Application Pools folder in IIS and choosing Add Application Pool.

打开windows命令行。切换目录C:\Windows\ Microsoft.Net \ Framework \ v4.0。xxxx,其中x是构建号。键入aspnet_regiis -ir并单击enter。这应该注册. net v4.0并在默认情况下创建应用程序池。如果没有,您需要通过右键单击IIS中的应用程序池文件夹并选择Add Application Pool来手动创建它们。

Edit: As a reference, please refer to the section of the linked document referring to the -i argument.

编辑:作为参考,请参考链接文档中有关-i参数的部分。

http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

#4


4  

I just encountered this and whilst we already had .NET 4.0 installed on the server it turns out we only had the "Client Profile" version and not the "Full" version. Installing the latter fixed the problem.

我刚刚遇到了这个问题,虽然我们已经在服务器上安装了。net 4.0,但结果是我们只有“客户端概要”版本,而没有“完整”版本。安装后者解决了问题。

#5


0  

Installing framework 4.0 redistributable is also enough to create application pool. You can download it from here.

安装framework 4.0 redistributable也足以创建应用程序池。你可以从这里下载。

#1


448  

Chances are you need to install .NET 4 (Which will also create a new AppPool for you)

您可能需要安装。net 4(它还将为您创建一个新的AppPool)

First make sure you have IIS installed then perform the following steps:

首先确保安装了IIS,然后执行以下步骤:

  1. Open your command prompt (Windows + R) and type cmd and press ENTER
    You may need to start this as an administrator if you have UAC enabled.
    To do so, locate the exe (usually you can start typing with Start Menu open), right click and select "Run as Administrator"
  2. 打开命令提示符(Windows + R),输入cmd,然后按ENTER键,如果启用了UAC,您可能需要以管理员的身份启动它。为此,找到exe(通常您可以开始输入并打开开始菜单),右键单击并选择“作为管理员运行”
  3. Type cd C:\Windows\Microsoft.NET\Framework\v4.0.30319\ and press ENTER.
  4. cd型C:\Windows\ Microsoft.NET \ Framework \ v4.0.30319 \并按ENTER。
  5. Type aspnet_regiis.exe -ir and press ENTER again.
    • If this is a fresh version of IIS (no other sites running on it) or you're not worried about the hosted sites breaking with a framework change you can use -i instead of -ir. This will change their AppPools for you and steps 5-on shouldn't be necessary.
    • 如果这是IIS的新版本(没有运行在其上的其他站点),或者您不担心托管站点会破坏框架更改,您可以使用-i而不是-ir。这将为您更改他们的apppool,不需要执行5-on步骤。
    • at this point you will see it begin working on installing .NET's framework in to IIS for you
    • 此时,您将看到它开始为您在IIS中安装。net框架
  6. aspnet_regiis类型。exe -ir和按回车键。如果这是IIS的新版本(没有运行在其上的其他站点),或者您不担心托管站点会破坏框架更改,您可以使用-i而不是-ir。这将为您更改他们的apppool,不需要执行5-on步骤。此时,您将看到它开始为您在IIS中安装。net框架
  7. Close the DOS prompt, re-open your start menu and right click Computer and select Manage
  8. 关闭DOS提示符,重新打开开始菜单,右键单击计算机,选择Manage
  9. Expand the left-hand side (Services and Applications) and select Internet Information Services
    • You'll now have a new applet within the content window exclusively for IIS.
    • 现在,您将在content窗口中拥有一个专门用于IIS的新applet。
  10. 展开左边(服务和应用程序)并选择Internet信息服务,您现在将在内容窗口中为IIS提供一个新的applet。
  11. Expand out your computer and locate the Application Pools node, and select it. (You should now see ASP.NET v4.0 listed)
  12. 展开您的计算机并定位应用程序池节点并选择它。(您现在应该看到ASP。净v4.0上市)
  13. Expand out your Sites node and locate the site you want to modify (select it)
  14. 展开站点节点并定位要修改的站点(选择它)
  15. To the right you'll notice Basic Settings... just below the Edit Site text. Click this, and a new window should appear
  16. 在右边你会注意到基本的设置…就在编辑网站文本下面。单击此按钮,将出现一个新窗口
  17. Select the .NET 4 AppPool using the Select... button and click ok.
  18. 使用Select…选择。net 4 AppPool。按钮并单击ok。
  19. Restart the site, and you should be good-to-go.
  20. 重新启动网站,你应该是一个好去处。

(You can repeat steps 7-on for every site you want to apply .NET 4 on as well).

(你也可以在每一个你想要应用。net 4的网站上重复步骤7-on)。


Additional References:

额外的引用:

  1. .NET 4 Framework
    The framework for those that don't already have it.
  2. 。net 4为那些还没有框架的人提供框架。
  3. How do I run a command with elevated privileges?
    Directions on how to run the command prompt with Administrator rights.
  4. 如何使用高级特权运行命令?关于如何使用管理员权限运行命令提示符的说明。
  5. aspnet_regiis.exe options
    For those that might want to know what -ir or -i does (or the difference between them) or what other options are available. (I typically use -ir to prevent any older sites currently running from breaking on a framework change but that's up to you.)
  6. aspnet_regiis。对于那些可能想知道-ir或-i做什么(或它们之间的区别)或其他选项可用的人,exe选项。(我通常使用-ir来防止当前运行的任何旧站点破坏框架更改,但这取决于您。)

#2


15  

In the top level of the IIS Manager (above Sites), you should see the Application Pools tree node. Right click on "Application Pools", choose "Add Application Pool".

在IIS管理器(上面的站点)的顶层,您应该看到应用程序池树节点。右键单击“应用程序池”,选择“添加应用程序池”。

Give it a name, choose .NET Framework 4.0 and either Integrated or Classic mode.

给它起个名字,选择。net Framework 4.0,选择集成模式或经典模式。

When you add or edit a web site, your new application pools will now show up in the list.

当您添加或编辑web站点时,您的新应用程序池将显示在列表中。

#3


14  

Open a windows command line. Switch directories to C:\Windows\Microsoft.Net\Framework\v4.0.xxxx where the x's are the build number. Type aspnet_regiis -ir and hit enter. This should register .Net v4.0 and create the application pools by default. If it doesn't, you will need to create them manually by right-clicking the Application Pools folder in IIS and choosing Add Application Pool.

打开windows命令行。切换目录C:\Windows\ Microsoft.Net \ Framework \ v4.0。xxxx,其中x是构建号。键入aspnet_regiis -ir并单击enter。这应该注册. net v4.0并在默认情况下创建应用程序池。如果没有,您需要通过右键单击IIS中的应用程序池文件夹并选择Add Application Pool来手动创建它们。

Edit: As a reference, please refer to the section of the linked document referring to the -i argument.

编辑:作为参考,请参考链接文档中有关-i参数的部分。

http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

#4


4  

I just encountered this and whilst we already had .NET 4.0 installed on the server it turns out we only had the "Client Profile" version and not the "Full" version. Installing the latter fixed the problem.

我刚刚遇到了这个问题,虽然我们已经在服务器上安装了。net 4.0,但结果是我们只有“客户端概要”版本,而没有“完整”版本。安装后者解决了问题。

#5


0  

Installing framework 4.0 redistributable is also enough to create application pool. You can download it from here.

安装framework 4.0 redistributable也足以创建应用程序池。你可以从这里下载。