I also fixed this issue by running

aspnet_regiis -i

using the visual studio command line tools as an administrator


This solved the problem

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i

Be sure to run the command prompt as administrator


For those getting this error in after installing .NET Framework 4.6 - Read and install one of these hotfixes to resolve the issue.


To resolve 'ASP.NET 4.0 has not been registered. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly' error when opening a solution we can:

1 Ensure the IIS feature is turned on with ASP.NET. Go to Control Panel\All Control Panel Items\Programs and Features then click 'Turn Windows Featrues on. Then in the IIS --> WWW servers --> App Dev Features ensure that ASP.NET is checked.

enter image description here

2 And run the following cmd line to install

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i

enter image description here

Hope this helps