Wednesday, November 12, 2008

Failed to access IIS metabase.

If you get an error saying "Failed to access IIS metabase." when you try to browse to a .Net App in the browser, it means that you installed IIS after you had ASP.Net installed.

To fix this problem all you need to do is run this command (on a command prompt) on your computer: %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

This will reinstall ASP.Net for use with IIS and in most cases fixes the error.

For reference, the full error that I received was as follows:

Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904

No comments: