Saturday, August 30, 2008

Failed to Access IIS Metabase

I have created a web setup application for an ASP.NET web application. It installs the application fine in my computer but when I try to run the installed web application the following error message appeared.

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.

For some reason IIS do not give read access to ASP.NET to its metabase.

What was the reason?

And then I remembered that I have installed IIS after installing Visual Studio 2005. So that meant there was a good possibility that IIS and ASP.NET didn't register each other properly. Now I had to find out a way to do that.

Well, back to the good old Internet for that. I gave abit of a search and found out what to do for the matter. The solution turned out to be a pretty straigh forword one.

This is what you do

  • Go to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
  • Then find "aspnet_regiis.exe"
  • Go to Start > Run
  • Type "cmd" and press Enter to go to the command prompt
  • Type cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 and Enter
  • Type "aspnet_regiis -i" and Enter
  • Give it a moment to install
  • And that's it. Your web application will run without the above error.