Published on: 20 August 2007 By: Ahsan Khan
Problem:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
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.
Cause:Microsoft .Net framework installation registers the framework on the IIS. Beside performing many other configrations in the OS and IIS, it also creates ACLs (Access Control List). .NET framework installation registers the framework in the IIS using ASP.NET IIS Registration Tool (aspnet_regiis.exe). The ASP.NET IIS registration tool allows installation program (or administrator) to update script maps for ASP.NET applications to point to the ASP.NET ISAPI version that is associated with the tool.
Solution:Run the following in the Command Prompt (cmd.exe)
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i-i switch is used for installing ASP.NET and upgrading all application pools to ASP.NET version which came with the ASP.NET IIS Registration Tool. It will ignore the previous version of application pool. Please note that the above command will only affect the applications that are currently mapped to an earlier version of ASP.NET.
The following command will install the script maps pointing to the ASP.NET version that is associated with the ASP.NET IIS Registration Tool to the application "App1".
aspnet_regiis -s W3SVC/1/ROOT/App1
Links related to this article:Microsoft:
ASP.NET IIS Registration Tool (Aspnet_regiis.exe)
View All Articles (Articles Archive)