HTTP Error 500.21 – Internal Server Error Ha...
Are you trying to migrate an existing ASP.NET application to ASP 4 / Visual Studio 2010 and having problems? When I was trying to do this, my ASP.NET application displayed the error listed in the title. This post will show you how I solved this problem. First though, I want to explain how I got to this point so that you can know if my scenario was the same as yours.
Scenario
Recently, I got around to reformatting my machine. With this reformat, I installed the following main components in the order listed.
- Windows 7 Ultimate
- Visual Studio 2010 Beta 2
- Office 2010 Beta 2
Once those components were installed, I decided to port my code over. I then attempted to run my application. At that point, I received the HTTP Error 500.21 – Internal Server Error Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” error.
I then verified that I had the .NET 4 Framework installed on my machine. Next I opened IIS 7 and ensured that my application was using the ASP4 application pool (which it was). Needless to say at this point I was confused.
Solution
After trying a variety of things, I decided to just re-install the .NET 4 Framework. I downloaded the framework from here, and ran it. After choosing to repair my installation, and restarting my computer, I found my application successfully working!

