我正在配置一个MVC 3项目,以在IIS的本地安装上工作,遇到了以下500个错误:

处理程序“PageHandlerFactory-Integrated”有一个坏模块 "ManagedPipelineHandler"在其模块列表中。

事实证明,这是因为ASP。Net没有完全安装IIS,即使我在“添加功能”对话框中勾选了该框。为了解决这个问题,我简单地在命令提示符下运行以下命令

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

如果我使用的是32位系统,它看起来会像下面这样:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

我的问题是,有没有一种方法可以在windows 7的机器上安装IIS来使用。net 4.0 (MVC 3)而不需要额外的步骤?


当前回答

接受的答案是正确的,但是有时您会得到“Aspnet_regiis.exe不能被识别为内部或外部命令、可操作程序或批处理文件”错误消息。

要解决这个问题,请尝试以下方法:

确保你的。net 4.0安装没有损坏(运行安装程序并“修复”它)。也有可能它根本没有安装在你的机器上。 如果你确定你没有安装。net 4.0,想要以。net 2.0的方式运行,试试这个:

如果您看到“Aspnet_regiis.exe未被识别为 内部或外部命令,可操作的程序或批处理文件 到 C:\Windows\ Microsoft.NET \ Framework64 \ v2.0.50727 \ Aspnet_regiis.exe - i 在命令提示符处。

其他回答

接受的答案是正确的,但是有时您会得到“Aspnet_regiis.exe不能被识别为内部或外部命令、可操作程序或批处理文件”错误消息。

要解决这个问题,请尝试以下方法:

确保你的。net 4.0安装没有损坏(运行安装程序并“修复”它)。也有可能它根本没有安装在你的机器上。 如果你确定你没有安装。net 4.0,想要以。net 2.0的方式运行,试试这个:

如果您看到“Aspnet_regiis.exe未被识别为 内部或外部命令,可操作的程序或批处理文件 到 C:\Windows\ Microsoft.NET \ Framework64 \ v2.0.50727 \ Aspnet_regiis.exe - i 在命令提示符处。

事实证明,这是因为ASP。Net没有完全安装IIS,即使我在“添加功能”对话框中勾选了该框。为了解决这个问题,我简单地在命令提示符下运行以下命令

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

如果我使用的是32位系统,它看起来会像下面这样:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

记住以管理员身份运行命令提示符(CTRL+SHIFT+ENTER)

要在Windows 8.1 Professional机器上修复此问题,请执行以下操作。

安装Web平台安装程序。http://www.microsoft.com/web/downloads/platform.aspx 在Web平台安装程序中安装ASP。NET 4.5(该特性有一个依赖项)。

如果你只是从最流行的答案中尝试前面提到的cmd提示命令,你会得到以下错误/警告消息:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.33440 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.33440). This option is not supported on this version of the operating system. Administr ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win dows Features On/Off" dialog, the Server Manager management tool, or the dism.e xe command line tool. For more details please see http://go.microsoft.com/fwlin k/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).

处理程序“PageHandlerFactory-Integrated”在它的模块列表中有一个坏模块“ManagedPipelineHandler”

我找到了修复这个问题的文章,只需在命令提示符下运行以下命令:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i

如果系统是32位的,它应该是这样的:

%windir%\Microsoft.NET\Framework\v4.0.21006\aspnet_regiis.exe -i

但是,当我尝试使用命令提示符执行这些命令时,我得到了以下错误/警告消息:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS version 4.0.30319.33440 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Start installing ASP.NET (4.0.30319.33440). This option is not supported on this version of the operating system. Administr ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win dows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlin k/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).**

要在Windows 8.1上修复这个问题,我建议做以下事情。

解决方案:

Goto:打开或关闭Windows功能-> Internet Information Services -> World Wide Web Services -> Application Development features ->开启或关闭ASP。NET 4.5

这应该能解决问题。

我尝试在命令提示符中做aspnet_regiis,但我得到的答案是我没有管理权限。 然后,在更多的谷歌搜索和寻找解决方案后,我尝试右键单击cmd并以管理员身份运行它。确认是,当出现对话框时,再次运行aspnet_iis,效果很好。 简而言之: 1. 检查。net框架在app_pool 2. 以管理员身份运行CMD 3.执行aspnet_regiis -i命令