It is required to register ASP.NET 4.0 with your application pool to run your ASP website built on ASP.NET 4.0, or you will receive the following 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.

Solution:
First of all, you will need to install the required ASP.NET version on the server where you have hosted the website. Check out the Microsoft Website to download the ASP.NET
The following are the steps to register ASP.NET 4.0 with the Application Pool in IIS.
1. Log in to your Windows Server.
2. Go to the location (C:\Windows\Microsoft.NET\Framework64\v4.0.30319) if you have a 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.


3. Open the command prompt with Run as administrator. You can right-click on the command prompt to open it with administrator access.
4. Once you open the command prompt, navigate to the path that we have copied in Step 2. This path should have the file called aspnet_regiis.exe
# cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

5. Enter the command below to register ASP.NET with IIS.
# aspnet_regiis -i
6. This will configure IIS to use ASP.NET 4.0 for your application pools. Refresh the website, and the error should be fixed.
Conclusion:
Registering ASP.NET 4.0 with IIS 7 is a crucial step to ensure your .NET applications run without compatibility errors. By following the steps above, installing ASP.NET, running the registration command, and verifying in IIS, you can quickly resolve the “extension configuration” error and get your site live again.
This process not only fixes errors but also ensures that IIS is properly configured to handle modern ASP.NET applications efficiently.
