Showing posts with label IIS. Show all posts
Showing posts with label IIS. Show all posts

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 ASP.net...and 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 ASP.net 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 ASP.net 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!