Failed to access IIS metabase
In the last couple of weeks I've formatted and reinstalled my laptop. It was one of the longest installations I've ever done and I encountered many problems during the installation.
This was a really annoying one.
After I finished the installation of windows, updated it, installed visual studio, and updated it also, I created a simple web-site to see that everything is working properly. When I browsed the site I received the this error:
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
Apparently a very good error description, so I entered the link and started to read. I must say, this was a complicated article about missing ACLs (Access Control List) that are necessary for accessing to the IIS.
A script was supplied in order to create them. Pretty nice. Shame it DOESN'T WORK!!!
After a couple of hours trying various attempts to make it work, I decided it's Google time! A quick search reveled the simplest solution: Reinstall the .Net framework redistributable.
I asked my self Why???
After all I had an installation of windows XP SP2 which comes with the framework built in.
I decided to dig a little more and found the problem.
Windows XP SP2 installation is secure by default. That means that IIS is not installed in the default installation. So after you install you must add it in the Add/Remove windows components in the control panel. What I didn't know is that the .Net framework installation registers the framework in the IIS. The registration is preformed with the command aspnet_regiis
which is located in "C:\Windows\Microsoft.NET\Framework\v2.0.50727".
This command performs many configurations in the IIS and in the operating system. One of them is to create the ACLs which grants the user which runs the ASP.net process to access the IIS metabase and other folders that ASP.Net needs in order to run properly. Another one is to apply the version of ASP.net on the web sites under the IIS (You can see the version under which your web site runs in the ASP.Net tab in the properties of your web site in the IIS administration tool).
What was the problem? I installed the IIS AFTER I installed the .Net framework which means that the aspnet_regiis command didn't run.
How do you fix this ? Simple. Run the following command in your favorite command window:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i
-i
indicates that you want to register the framework in IIS.
Always remember : Google is the greatest!