Trouble with .NET 4 Installation

The most common error with the default installation is:

HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

If you are getting an error like the one above, you may need to re-register the .NET 4 run time using the following command:

If on a 32 bit system, use the following: