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


当前回答

事实证明,这是因为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)

其他回答

当我试图将一个应用程序从经典切换到集成时,我在我的一个web服务器上遇到了这个问题。它在我的其他两个服务器上工作得很好,而不仅仅是这一个。它是Server 2012,所以你不能做aspnet_regiis,也没有安装缓存文件夹来尝试修复。在特征下,一切都被正确设置。

运行%windir%\system32\inetsrv\config\applicationHost。我发现了一个关键的缺失位。在我那张没有工作的表格下面,少了两行字:

        <add name="ManagedEngineV4.0_32bit" image="C:\Windows\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
        <add name="ManagedEngineV4.0_64bit" image="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />

一旦我添加了它们,一切都运行得很好。

接受的答案是正确的,但是有时您会得到“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 在命令提示符处。

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

启用32位应用程序= true

然后它工作得很好!

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

-使用应用程序初始化功能 -由于配置继承而请求错误的页面(.asp)

500.21只会出现在第一个用户连接上。后续连接正常。

通过纠正。net网站上的applicationInitialization url集合来解决。