[英]How to add ASP.NET 4.0 as Application Pool on IIS 7, Windows 7
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在IIS Manager 中,我选择Application Pools并且只看到
- Classic .NET AppPool -经典的.NET AppPool
- DefaultAppPool -默认应用程序池
I need to also be able to select from我还需要能够从中选择
- ASP.NET v4.0 - ASP.NET v4.0
- ASP.NET v4.0 Classic - ASP.NET v4.0 经典版
How can I add these to the list of available application pools?如何将这些添加到可用应用程序池列表中?
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,然后执行以下步骤:
cmd
and press ENTERcmd
并按ENTERcd C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\
and press ENTER .cd C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\
并按ENTER 。aspnet_regiis.exe -ir
and press ENTER again.aspnet_regiis.exe -ir
并再次按ENTER 。
-i
instead of -ir
.-i
而不是-ir
。 This will change their AppPools for you and steps 5-on shouldn't be necessary. (You can repeat steps 7-on for every site you want to apply .NET 4 on as well). (您也可以对要应用 .NET 4 的每个站点重复第 7 步)。
Additional References:其他参考资料:
-ir
or -i
does (or the difference between them) or what other options are available.-ir
或-i
作用(或它们之间的区别)或其他可用选项的人。 (I typically use -ir
to prevent any older sites currently running from breaking on a framework change but that's up to you.) -ir
来防止当前运行的任何旧站点因框架更改而中断,但这取决于您。)In the top level of the IIS Manager (above Sites), you should see the Application Pools tree node.在 IIS 管理器的顶层(站点上方),您应该会看到应用程序池树节点。 Right click on "Application Pools", choose "Add Application Pool".
右键单击“应用程序池”,选择“添加应用程序池”。
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.当您添加或编辑网站时,您的新应用程序池现在将显示在列表中。
Open a windows command line.打开 Windows 命令行。 Switch directories to
C:\\Windows\\Microsoft.Net\\Framework\\v4.0.xxxx
where the x's are the build number.将目录切换到
C:\\Windows\\Microsoft.Net\\Framework\\v4.0.xxxx
,其中 x 是内部版本号。 Type aspnet_regiis -ir
and hit enter.输入
aspnet_regiis -ir
并按回车键。 This should register .Net v4.0 and create the application pools by default.这应该注册 .Net v4.0 并默认创建应用程序池。 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
.如果没有,您需要通过右键单击 IIS 中的
Application Pools
文件夹并选择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
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.我刚刚遇到了这个问题,虽然我们已经在服务器上安装了 .NET 4.0,但结果我们只有“客户端配置文件”版本而不是“完整”版本。 Installing the latter fixed the problem.
安装后者解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.