Handler "PageHandlerFactory-Integrated" has a bad module

On Windows 2008R2 servers we've encountered this error in IIS after installing .NET 4.0 and switching the app pool to use .NET 4.0:

 

Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.

 

This is a bug in the .NET installation, and if you get this error the easiest way to fix it is to run this at the command prompt:

 

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

© 2019 One-to-One Service.com, Inc.