In this article I will explain how to solve the following error happening in Visual Studio and IIS server.
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly, Press F1 for more details.
 
 
Installing the .Net Framework
The very first thing you need to do is download and install the necessary .Net Framework on your system.
 
Look for the aspnet_regiis.exe file
Once the .Net Framework is installed, you can look for the aspnet_regiis.exe file for registering the .Net Framework in IIS server.
If your windows is installed in C drive you could find the aspnet_regiiis.exe at the following locations.
32 BIT
C:\Windows\Microsoft.NET
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server


64 BIT
C:\Windows\Microsoft.NET\Framework64
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server

Now based on whether your System is 32 BIT or 64 BIT and the .Net Framework version you want to register, you need to get into the .Net Framework Folder.
In my case the Windows is 64 BIT and I need to register .Net Framework 4 I am looking for the aspnet_regiis.exe in the following location C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server

 
Registering the ASP.Net with IIS server
Now you need to start command prompt by typing cmd at the Run command and then execute the command prompt with Administrator rights by right clicking and choosing Run as administrator from the context menu.
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server
 
Then on the command prompt you need to navigate to the Directory that has the aspnet_regiis.exe file for that you need to type
CD C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
And then you need to type the following command and hit enter to register ASP.Net with IIS.
aspnet_regiis -i

ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server
 
Once the ASP.Net is installed in IIS, you will see ASP.Net 4.0 Application pools in the IIS server
ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server
 
That’s it and you are done with registering the ASP.Net with IIS. Here I have shown you how to register .Net Framework version 4.0 in similar way you can register other versions.