Monday, December 1, 2008

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

Source : http://support.microsoft.com/kb/555583

SUMMARY
In this article, you will learn how to fix an exception which occurs rarely with...

In this article, you will learn how to fix an exception which occurs rarely with an ASP.NET 2.0 application.

SYMPTOMS
The HostingEnvironmentException error occurs when you attempts to run an ASP.NET...

The HostingEnvironmentException error occurs when you attempts to run an ASP.NET 2.0 application.

CAUSE
The most probable cause for this error is that you must have installed Internet...

The most probable cause for this error is that you must have installed Internet Information Services (IIS) after the installation of Microsoft .NET Framework 2.0.

RESOLUTION
Follow the steps given below to fix this error (1) Go to Start | Control Panel |...

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 will 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.

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

Source : http://www.cs.nyu.edu/~vs667/articles/asp_metabase_error/index.php

ERROR:


Exception Details: 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.

Source Error:
An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492170
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189



SOLUTION:


This Particular error is trivial, yet has contributed to countless headaches.
It occurs in many cases when IIS is installed after .NET 2.0.
To fix it, download Microsoft .NET Framework 2.0 once again and perform a "repair installation".
The "repair installation" feature is available in the .NET 2.0 Redistributable Version

IIS Errors on Windows XP: Failed to access IIS metabase, and Mutex could not be created

Failed to access IIS metabase

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

I solved this by Reinstalling the .NET 2.0 Framework via aspnet_regiis -i

Mutex could not be created

System.InvalidOperationException: Mutex could not be created

The Solution for this error is bit more complicate:

  1. Close all opened Visual Studios.

  2. Navigate to C:\Windows\Microsoft.NET\Framework\v2[....]\Temporary ASPNET pages.

  3. Delete the folder for your application (You can delete the temporary folder completley)

  4. Perform IISReset via command line or via inetmgr.exe

  5. Browse your application directly from IIS and not from any where else.

  6. You should see your application correctly now.


Good Luck !