Monday, January 17, 2011

How to Fix "PageHandlerFactory-Integrated" bad module "ManagedPipelineHandler in IIS7

After setting up a new Windows 7 computer with IIS 7.5 and Visual Studio 2010, I tried to start my ASP.NET 4.0 website using the Local IIS web server. However, right off the bat I was hit with the following IIS error message:

HTTP Error 500.21 - Internal Server Error
Handler 'PageHandlerFactory-Integrated' has a bad module 'ManagedPipelineHandler' in its module list.

Apparently, the reason I was recieving the Internal Server error message was that I had installed SQL Server 2008, after installing Visual Studio 2010, and because of this it corrupted the IIS Machine level configuration files ('If you install VS2010 and then install VS2008 and VS2008 SP1, the configuration files for ASP.NET in IIS only include about 1/2 of the correct .Net 4.0 configuration sections.' read more here).

To repair this problem I ran a full silent repair of the .NET Framework 4.0. Here's how on either a 32 bit or 64 bit computer:

1. Click Start -> All Programs -> Accessories -> Run
2. In the Open textbox paste in the following line (see list of all .NET Framework version install, repair and unistall command lines here):

For silent repair on 32 bit computer with .Net Framework version 4.0.30319 use:

%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

For silent repair on 64 bit computer with .Net Framework version 4.0.30319 use:

%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart

3. Click OK to start the repair
4. After, the repair ran for a few minutes, I restarted IIS 7.5, and things began to work correctly!

Hopefully, that will work for you...

No comments: