On IIS7 server when you host an Asp.net Application and configure an App Pool with .NET 4.0 Integrated pipeline, you might get following error
HTTP Error 500.21 – Internal Server Error
Handler "PageHandlerxxx-Integrated" has a bad module "ManagedPipelineHandler" in its module list.
However the website is working perfect in the Visual Studio Development Server, just not in IIS. In such case we can try to repair Asp.net by following steps below.
1. Click Start -> All Programs -> Accessories -> Run
2. In the Open textbox paste in the following line:
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. The repair ran for a few minutes, once done please restart IIS, the site should work correctly!