Solution for HTTP Error 500.21 – Internal Server Error – Bad module “ManagedPipelineHandler” on IIS 7.5

13 comments -

This problem has been encountered after the production server has been upgraded to Windows Sever 2008 R2 and the ASP.NET solution has been moved on the .NET 4.0 platform.

The ASP.NET application was put to run in a ASP.NET v4.0 with Integrated Managed Pipeline application pool. The application was updated using Visual Studio 2010.After installing the necessary IIS 7.5 roles and features and publishing the website, i have encountered this error

HTTP Error 500.21 – Internal Server Error
Handler “WebServiceHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list.

In the Visual Studio Development Server the site was running fine, until we tested the Crystal Reports………, but this is another problem.

If I change the application pool to Classic .NET AppPool the problem does not persist, but it is not the solution.

On the error page, most likely causes are:

  • manged handler is used; however, ASP.NET is not istalled or is not installed completely;
  • there is a typographical error in the configuration for the handler module list.

The first suggestion is the most likely to be true and after searcing the Web I found the source of the problem: installing  SQL Server 2008, after installing Visual Studio 2010 may corrupt IIS Machine level configuration files: Installing VS2010 before VS2008 Results In Corrupt IIS Machine Level Configuration Files

Solutions for this problem are:

  • silent repair of the 4.0 .NET Framework
    • for 32 bit servers with .Net Framework version 4.0.30319 run the command (in command prompt):%windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
    • for 64 bit servers with .Net Framework version 4.0.30319 run the command:%windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
  • install the ASP.NET version and configure IIS to use it
    • open command prompt (Start -> cmd) and for 32 bit servers run the command%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe /i
    • open command prompt (Start -> cmd) and for 64 bit servers run the command%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe /i

, ,


  1. #1 by Fabian on May 12th, 2011

    Thank you very much for your solution. This is working very well and easy to do ;-)

  2. #2 by Mumu on August 5th, 2011

    Works perfectly. Thanks!

  3. #3 by Edo Tzumer on October 25th, 2011

    Bravo :)

  4. #4 by denz on February 14th, 2012

    Thank for your help!!!

  5. #5 by Fabio on March 4th, 2012

    Your Solutions for this problem were absolutly fantastic!!!
    NOW PERFECTLY WORKEING!!!
    You saved my mental sanity.
    THANKS!!!

  6. #6 by BEK on April 1st, 2012

    Well, this just made my day !

  7. #7 by loga on May 9th, 2012

    thanks a lot,.. solved the issue…

  8. #8 by ei.theint on June 5th, 2012

    Thanks a lot. I was trying to solve the problem this whole evening. now i solved ready with this solution. Thanks you very very much. :)

  9. #9 by Mudz on September 21st, 2012

    great…….. thxxxxxxxxxxxxx

  10. #10 by Manuel Jose on January 26th, 2013

    You nail it! Thanks a lot. This really saved my day.

  11. #11 by Freddy on February 18th, 2013

    Excelent. Thanks

  12. #12 by Neel on April 5th, 2013

    Wonderful solution..

  13. #13 by arvind on December 30th, 2013

    worked very well…Thanks for help.

(will not be published)

  1. No trackbacks yet.