Requested content appears to be script and will not be served by the static file handler

Problem: When I installed my new computer I had problems running .NET framework 4.0 website on IIS7.0. the error I got is like:

HTTP Error 404.17 - Not Found "The requested content appears to be script and will not be served by the static file handler."

Solution:

This is because there was no framework 4.0 handler mappings for .aspx files. You need admin user rights to run the below command. Go to command prompt and run below: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

Cheers :)