Monday, May 18, 2009

System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase

I have seen this error for the first time today. This error comes when you have installed Microsoft .Net Framework 2.0 or later before installing Internet Information Services (IIS). I was able to find a solution via google easily, but thought its nice to put on this blog.

RESOLUTION

Follow the steps given below to fix this error

(1) Go to Start | Control Panel | Add and Remove Programs

(2) Click on the entry titled Microsoft .NET Framework 2.0 and select Change/Remove. The Microsoft .NET Framework 2.0 Setup dialog box opens up.

(3) Select the option titled Repair and the setup automatically performs the required repair work.

(4) You might be prompted to reboot the system after the completion of the process.

(5) Run the affected ASP.NET 2.0 application once again and the application should work fine without any problems.

NOTE : If you have installed Visual Studio 2008 Beta or Visual Web Developer Express Beta or .Net Framework 3.5, you may need to repair the .Net Framework 3.5 (Even though you use ASP.Net 2.X in your IIS). You may also need to go to IIS control panel and re-select the ASP.Net version.