When you try to run MVC site or ASP.Net framework 4 website, if you receive the following error: HTTP Error 500.21 - Internal Server Error. Saying Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list. It means the ASP.Net has not been properly registered on your IIS.
To fix this issue, you can run the following command in your cmd prompt.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
Once it has been installed successfully, try to re-run the website again.