asp.net-mvc 如何修复:处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个坏模块“ManagedPipelineHandler”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6846544/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 01:21:22  来源:igfitidea点击:

How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

asp.net-mvciis-7configurationasp.net-4.0

提问by hspain

I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error:

我正在配置一个 MVC 3 项目以在本地安装 IIS 并遇到以下 500 错误:

Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.

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

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. To fix this, I simply ran the following command at the command prompt

事实证明,这是因为 ASP.Net 并未与 IIS 一起安装,即使我在“添加功能”对话框中选中了该框。为了解决这个问题,我只是在命令提示符下运行以下命令

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

If I had been on a 32 bit system, it would have looked like the following:

如果我使用的是 32 位系统,它将如下所示:

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

My question is, is there a way to install IIS on a windows 7 box to use .NET 4.0 (MVC 3) without taking this extra step?

我的问题是,有没有办法在 Windows 7 机器上安装 IIS 以使用 .NET 4.0 (MVC 3) 而无需执行此额外步骤?

回答by hspain

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the "Add Feature" dialog. To fix this, I simply ran the following command at the command prompt

事实证明,这是因为 ASP.Net 并未与 IIS 一起安装,即使我在“添加功能”对话框中选中了该框。为了解决这个问题,我只是在命令提示符下运行以下命令

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

If I had been on a 32 bit system, it would have looked like the following:

如果我使用的是 32 位系统,它将如下所示:

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

Remeber to run the command prompt as administrator (CTRL+SHIFT+ENTER)

Remeber运行命令提示管理员身份(CTRL+ SHIFT+ ENTER

回答by Nikita G.

The accepted answer is correct, however sometimes you would get the "Aspnet_regiis.exe is not recognized as an internal or external command, operable program or batch file." error message.

接受的答案是正确的,但是有时您会收到“ Aspnet_regiis.exe 不是内部或外部命令、可运行的程序或批处理文件。”错误消息。

To resolve it try the following:

要解决它,请尝试以下操作:

  1. Make sure that your .NET 4.0 installation is not corrupted (run the installer and 'Repair' it). There's also a chance it is not installed on your machine at all.

  2. If you're sure you don't have .NET 4.0 installed and want to run it as .NET 2.0, try this:

  1. 确保您的 .NET 4.0 安装没有损坏(运行安装程序并“修复”它)。也有可能它根本没有安装在您的机器上。

  2. 如果您确定没有安装 .NET 4.0 并希望将其作为 .NET 2.0 运行,请尝试以下操作

If you see the message "Aspnet_regiis.exe is not recognized as an internal or external command, operable program or batch file.", switch to the C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet_regiis.exe -iat the command prompt.

如果您看到消息“Aspnet_regiis.exe 不是内部或外部命令、可运行的程序或批处理文件。”,请切换到 C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Aspnet_regiis.exe -i在命令提示符下。

回答by Shah

To solve the issue try to repair the .net framework 4and then run the command

要解决此问题,请尝试repair the .net framework 4然后运行命令

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

回答by Shubham Gupta

Error: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

错误:处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误的模块“ManagedPipelineHandler”

I found the articles to fix this issue by simply run the following commands at the command prompt:

我找到了通过在命令提示符下运行以下命令来解决此问题的文章:

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

If the system is 32 bit, it would have looked like this:

如果系统是 32 位,它看起来像这样:

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

But, when I tried to execute these commands using a command prompt, I got the following error/warning message:

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

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/fwlink/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).**

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS 版本 4.0.30319.33440 用于在本地计算机上安装和卸载 ASP.NET 的管理实用程序。版权所有 (C) 微软公司。版权所有。开始安装 ASP.NET (4.0.30319.33440)。此版本的操作系统不支持此选项。管理员应改为使用“打开/关闭 Windows 功能”对话框、服务器管理器管理工具或 dism.exe 命令行工具来安装/卸载带有 IIS8 的 ASP.NET 4.5。有关更多详细信息,请参阅http://go.microsoft.com/fwlinkk/?LinkID=216771。完成安装 ASP.NET (4.0.30319.33440).**

To fix this on a Windows 8.1, I would suggest to do the following thing.

要在 Windows 8.1 上解决此问题,我建议执行以下操作。

Solution:

解决方案:

Goto: Turn Windows features on or off -> Internet Information Services -> World Wide Web Services -> Application Development Features -> Enable ASP.NET 4.5

转到:打开或关闭 Windows 功能 -> Internet 信息服务 -> 万维网服务 -> 应用程序开发功能 ->启用 ASP.NET 4.5

This should resolve the issue.

这应该可以解决问题。

回答by BornToCode

I would also check the obvious first: that the application pool is set to the correct framework and that your IIS application actually points to the folder where you put your files

我还将首先检查明显的:应用程序池设置为正确的框架,并且您的 IIS 应用程序实际上指向您放置文件的文件夹

回答by Kent

I added the ISAPI/CGI paths for .Net 4. Which didn't fix the issue. So I then ran a repair on the .Net V4 (Client and Extended) installation. Which asked for a reboot. This fixed it for me.

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

回答by David Veksler

If you want to deploy an MVC application without installing MVC, you can deploy the MVC DLL's with your application. This gets around installing MVC 3. You can use features in some .Net 4.0 namespaces without installing .Net using a similar approach.

如果您想在不安装 MVC 的情况下部署 MVC 应用程序,您可以将 MVC DLL 与您的应用程序一起部署。这绕过了安装 MVC 3。您可以使用某些 .Net 4.0 命名空间中的功能,而无需使用类似的方法安装 .Net。

回答by PussInBoots

To fix this on a Windows 8.1 Professionalmachine do the following.

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

  1. Install the Web Platform Installer. http://www.microsoft.com/web/downloads/platform.aspx

  2. In Web Platform Installer install ASP.NET 4.5(This feature has one dependency).

  1. 安装 Web 平台安装程序。http://www.microsoft.com/web/downloads/platform.aspx

  2. 在 Web 平台安装程序中安装ASP.NET 4.5(此功能有一个依赖项)。

If you simply try the aforementioned cmd prompt command from the most popular answer you will get the following error/warning message:

如果您只是从最流行的答案中尝试上述 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/fwlink/?LinkID=216771. Finished installing ASP.NET (4.0.30319.33440).

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i Microsoft (R) ASP.NET RegIIS 版本 4.0.30319.33440 用于在本地计算机上安装和卸载 ASP.NET 的管理实用程序。版权所有 (C) 微软公司。版权所有。开始安装 ASP.NET (4.0.30319.33440)。 此版本的操作系统不支持此选项。管理员应改为使用“打开/关闭 Windows 功能”对话框、服务器管理器管理工具或 dism.exe 命令行工具安装/卸载带有 IIS8 的 ASP.NET 4.5。有关更多详细信息,请参阅http://go.microsoft.com/fwlinkk/?LinkID=216771。完成安装 ASP.NET (4.0.30319.33440)。

回答by Willow

I have tried to do aspnet_regiis in command prompt but I got answer that I don't have admin rights. Then, after some more googling and looking for a solution I tried to right click cmd and run it as an admin. Confirmed yes when dialog appeared, ran aspnet_iis again ant worked like a charm. In short: 1. check .NET framework in app_pool 2. run cmd as an admin 3. run aspnet_regiis -i

我曾尝试在命令提示符下执行 aspnet_regiis,但得到的回答是我没有管理员权限。然后,经过更多的谷歌搜索并寻找解决方案后,我尝试右键单击 cmd 并以管理员身份运行它。当对话框出现时确认是,再次运行 aspnet_iis ant 就像一个魅力。简而言之: 1. 检查 app_pool 中的 .NET 框架 2. 以管理员身份运行 cmd 3. 运行 aspnet_regiis -i

回答by Ryan Burbidge

I had the same problem and my solution was:

我遇到了同样的问题,我的解决方案是:

Go to "Turn Windows features on or off" > Internet Information Services > World Wide Web Services > Application Development Features >Enable ASP.NET 4.5

转到“打开或关闭 Windows 功能”> Internet 信息服务 > 万维网服务 > 应用程序开发功能 > 启用 ASP.NET 4.5