It is required to register ASP.NET 4.0 with your application pool inorder to run your ASP website build on ASP.NET 4.0 or you will receive the below error.
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
First of all, you will need to install the required ASP.NET version on your server where you have hosted the website. Checkout Microsoft Website to download the ASP.NET
Following are the steps to Register ASP.NET 4.0 with Application Pool in IIS.
- Log in to your Windows Server.
- Go to the location (C:\Windows\Microsoft.NET\Framework64\v4.0.30319) if you have 64 bit OS or Go to the location (C:\Windows\Microsoft.NET\Framework\v4.0.30319) if you have 32 bit OS and copy the path and copy the path.
- Open the command prompt with Run as administrator. You can Right-Click on command prompt to open it with administrator access.
- Once you open the command prompt, navigate to the path which we have copied on Step (2). This path should have the file called aspnet_regiis.exe
- Enter the below command to register ASP.NET with IIS.
- You will see the ASP.NET application pool inside the IIS application pool in IIS. Refresh the website and error should be fixed.