IIS 7–Error – Handler PageHandlerFactory-Integrated has a bad module ManagedPipelineHandler in its module list
Whilst deploying a WCF service on a clean Windows Server 2008 R2 with IIS 7.5 I kept having an HTTP Error 500 Internal server error. When browsing to the localhost on the webserver, I discovered the actual error was: “Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list”.

This issue can easily be resolved by running the following command (replace v4.0.30319 with your own version).
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i