Complete Guide to Resolving Handler "PageHandlerFactory-Integrated" Bad Module "ManagedPipelineHandler" Error in IIS

Nov 22, 2025 · Programming · 13 views · 7.8

Keywords: IIS Configuration | ASP.NET Error | Module Registration

Abstract: This article provides a comprehensive analysis of the HTTP 500.21 error encountered when configuring ASP.NET MVC 3 projects in IIS, focusing on the root cause of Handler "PageHandlerFactory-Integrated" having a bad module "ManagedPipelineHandler". Through in-depth exploration of ASP.NET 4.0 integration mechanisms with IIS, it offers step-by-step guidance using the aspnet_regiis.exe tool for problem resolution, including specific commands for both 32-bit and 64-bit systems. The article also discusses application pool configuration verification and preventive measures to help developers completely resolve such deployment issues.

Problem Background and Error Analysis

When deploying ASP.NET MVC 3 projects to a local IIS environment, developers frequently encounter HTTP 500.21 Internal Server Error. The specific error message indicates that Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list. This error signifies that IIS cannot properly recognize and process ASP.NET requests, typically occurring when .NET Framework 4.0 integration with IIS is incomplete.

Root Cause Investigation

Through thorough analysis, the primary cause of this error is the incomplete installation of ASP.NET 4.0 framework into IIS. Even when the ASP.NET option is checked in the Windows Features dialog, the system may fail to properly register all necessary handlers and modules. This situation commonly occurs in scenarios such as:

Solution Implementation

To resolve this issue, the ASP.NET IIS Registration Tool (aspnet_regiis.exe) must be used to re-register the ASP.NET 4.0 framework. The specific implementation steps are as follows:

Step 1: Determine System Architecture

First, confirm the architecture type of the operating system, which will determine which version of the registration tool to use.

Step 2: Execute Registration Command

For 64-bit operating systems, open Command Prompt with administrator privileges and execute the following command:

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

For 32-bit operating systems, the corresponding command is:

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

Important Note: Command Prompt must be run with administrator privileges, achievable by pressing <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>ENTER</kbd> combination.

Configuration Verification and Optimization

After completing the registration, verify that the application pool configuration is correct:

Preventive Measures and Best Practices

To prevent similar issues from recurring, it is recommended to:

Technical Principles Deep Dive

The primary function of the aspnet_regiis.exe tool is to register ASP.NET file mappings and configuration settings with IIS. When executing the -i parameter, this tool will:

This process ensures that IIS can correctly recognize and process ASP.NET requests, which is particularly crucial for the routing mechanisms used by MVC frameworks.

Copyright Notice: All rights in this article are reserved by the operators of DevGex. Reasonable sharing and citation are welcome; any reproduction, excerpting, or re-publication without prior permission is prohibited.