System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
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.
This is one of the most common error developers see when then install Visual studio and start running thier first application in debug mode. Don't get panic when you see this error, it cab resolved by just executing the below command in Visual studion command prompt.
aspnet_regiis -ga "MachineName/ASPNET"
What it does is, it will give IIS metabase access to the ASPNET account.
Updated on: 07- March -2012
Recently we got this error in our Live environement using Windows 2000 server and found that issue didn't resolve even after executing this command.
You may follow below steps to resolve the issue in such cases,
Open IIS -->Locate Default Website-->Right Click and select Properties-->Go to Operators Tab and check ASPNET account is added here or not. If it is not there then Click on "Add" button and add ASPNET account and click OK.