我正在配置一个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)而不需要额外的步骤?


当前回答

处理程序“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

这应该能解决问题。

其他回答

我为。net 4添加了ISAPI/CGI路径。这并没有解决问题。 因此,我随后对. net V4(客户端和扩展版)安装进行了修复。它要求重启。这为我解决了问题。

我遇到了这个问题,发现删除以下文件夹有所帮助,即使是非express版本。表达:

C:\Users\ <用户> \ \ IISExpress文档

要在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).

这些对我都没用。所以当我比较各种应用程序池时,我必须进入应用程序池的高级设置,并进行设置

启用32位应用程序= true

然后它工作得很好!

我还会检查第一个显而易见的问题:应用程序池是否设置为正确的框架,并且您的IIS应用程序实际上指向您放置文件的文件夹