a blog for those who code

Tuesday 29 December 2015

How to solve "The page you are requesting cannot be served" Error

In this post we will be discussing about how to fix "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."

This is a very common issue and happens when IIS is installed after VS or .NET framework installation. To fix this issue you need to use aspnet_regiis.exe to register version of .NET framework you are using. Lets say you are using .NET Framework 4.5 then go to cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ and run aspnet_regiis -i.

You should run cmd.exe as administrator otherwise you might get an error like "An error has occured: 0x8007b799. You must have administrative rights on this machine in order to run this tool".

According to MSDN, ASP.Net ISS Registration Tool (aspnet_regiis.exe) allows an administrator to easily update the script maps for an ASP.NET application to point to the ASP.NET ISAPI version that is associated with the tool. The tool can be used to display the status of all installed versions of ASP.NET, register the ASP.NET version that is coupled with the tool, create client-script directories, and perform other configurations operations.

aspnet_refiis -i : It installs the version of ASP.NET that is associated with the Aspnet_regiis.exe and updates the script maps at the IIS metabase root.

If doing above did not solve your problem, you might need to add MIME types for each file extention that you wanted to serve through IIS.

    <mimeMap fileExtension=".json" mimeType="application/javascript"

Please Like and Share the CodingDefined.com Blog, if you find it interesting and helpful.

No comments:

Post a Comment