如何在 IIS 7、Windows 7 上将 ASP.NET 4.0 添加为应用程序池 [英] How to add ASP.NET 4.0 as Application Pool on IIS 7, Windows 7
问题描述
无论如何,配置服务器都不是我的强项.我正在尝试将开发项目移至 Windows 7.运行应用程序需要做的一件事是选择 ASP.NET v4.0 作为 IIS 中的应用程序池.
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.
我按照以下链接中的说明进行操作,以确保选择了正确的应用程序开发选项:
I went through the directions in the following link to make sure that the proper Application Development Options were selected:
http://www.gotknowhow.com/文章/how-to-install-iis7-and-enable-aspnet
在 IIS 管理器中,我选择应用程序池,然后只看到
- 经典 .NET 应用程序池
- DefaultAppPool
From within the IIS Manager, I select Application Pools and only see
- Classic .NET AppPool
- DefaultAppPool
我还需要能够选择
- ASP.NET v4.0
- ASP.NET v4.0 经典版
如何将这些添加到可用应用程序池列表中?
How can I add these to the list of available application pools?
推荐答案
您可能需要安装 .NET 4(这也会为您创建一个新的 AppPool)
Chances are you need to install .NET 4 (Which will also create a new AppPool for you)
首先确保您已安装IIS 然后执行以下步骤:
First make sure you have IIS installed then perform the following steps:
- 打开命令提示符 (Windows + R) 并输入
cmd
并按 ENTER
如果您启用了 UAC,您可能需要以管理员身份启动.
为此,请找到 exe(通常您可以在开始菜单打开的情况下开始输入),右键单击并选择以管理员身份运行" - 输入
cd C:WindowsMicrosoft.NETFrameworkv4.0.30319
并按 ENTER. - 输入
aspnet_regiis.exe -ir
并再次按 ENTER.- 如果这是 IIS 的新版本(没有其他站点在其上运行)或者您不担心托管站点因框架更改而中断,您可以使用
-i
而不是-ir
.这会为您更改他们的 AppPools,并且不需要执行第 5 步. - 此时您将看到它开始为您将 .NET 的框架安装到 IIS 中
- 如果这是 IIS 的新版本(没有其他站点在其上运行)或者您不担心托管站点因框架更改而中断,您可以使用
- 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" - Type
cd C:WindowsMicrosoft.NETFrameworkv4.0.30319
and press ENTER. - 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. - at this point you will see it begin working on installing .NET's framework in to IIS for you
- 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
- 您现在将在内容窗口中拥有一个专用于 IIS 的新小程序.
(您也可以对要应用 .NET 4 的每个站点重复第 7 步).
(You can repeat steps 7-on for every site you want to apply .NET 4 on as well).
其他参考资料:
- .NET 4 框架
适用于尚未拥有的框架. - 如何运行命令提升权限?
有关如何以管理员权限运行命令提示符的说明. - aspnet_regiis.exe 选项
对于那些可能想知道-ir
或-i
的作用(或它们之间的区别)或其他可用选项的人.(我通常使用-ir
来防止当前运行的任何旧站点因框架更改而中断,但这取决于您.)
- .NET 4 Framework
The framework for those that don't already have it. - How do I run a command with elevated privileges?
Directions on how to run the command prompt with Administrator rights. - 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.)
这篇关于如何在 IIS 7、Windows 7 上将 ASP.NET 4.0 添加为应用程序池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!