Thursday, February 14, 2008

[.NET, IIS] Failed to access IIS metabase

After one year of Apache, Java and PHP, last week I installed on my home server IIS on a different port (getting all together with Apache on port 80) just in case, I thought, I'd have decided to learn some finally I did.
[.Net, J2EE] A walk from J2EE to .NET: impressions and hopes was a preamble to this kind of experiment.
Anyway I left IIS with an orrifying HTML static page with a list of bullshit about me.

When I started learning I had no chance to try some of my new language scripts in my brand new web server, and I found that IIS didn't recognize the header of my .aspx page (XML parsing error)!

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="CurrencyConverter.aspx.cs" Inherits="CurrencyConverter" %>

I found it is a common problem: you should not install IIS before .NET framework, because it will lose the reference to the brand new .NET framework.

Solution (1): uninstall IIS and reinstall it (from Control Panel -> Install applications -> Windows Components -> IIS, of course in Windows XP).

That didn't work, even if after that IIS answered with a bad error:

It is a "Failed to access IIS metabase" error ... Oh my Gosh!!!
Google helped me again , in few searches.

Solution (2): it seems to be a problem of the .NET 2.0 version. You just need to reset all 2.0 registry keys, by moving to your framework directory (usually C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) and executing:
aspnet_regiis -i
And finally all worked perfectly, with my super useful Currency Converter web application! Thanx uncle Bill!


Anonymous said...

I have windows 200 and persist the problem failed to access iis metabase

Scuffia said...

I found another console fix:
" aspnet_regiis –ga ASPNET ", it is related to the .NET ASP user, but I'm not aware of what it really fix.
Try (no risks anyway) or let me know how you fixed it!

Anonymous said...

I had the same issue "Failed to access IIS metabase" after installing CruiseControl .NET with .NET Framework 2.0. After your suggestion, I did "aspnet_regiis -i" and it magically did the trick! The /ga option as suggested from the MSDN didn't work for me. Thanks for the posting.

Scuffia said...

I love the magic of the butcher!
I'm glad to have helped you!

Anonymous said...

The incantation "aspnet_regiis -ga ASPNET" made the magic happen for me. My surviving hair follicles and I thank you!

Anonymous said...

Thank you!! Solution 2 worked for me.

E$ said...

Thank you for this post. I've stepped off the MS bus temporarily and I'm starting to think I won't be getting back on.


Anonymous said...

This worked great! Thank you for posting the solution. Praise Google, the compendium of all knowledge! :-)