"An error occurred while accessing the IIS metadatabase" When configuring the ASP. NET platform"

Source: Internet
Author: User
"An error occurred while accessing the IIS metadatabase" When configuring the ASP. NET platform"

The following error message is returned:

An error occurred while accessing the IIS metadatabase.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details: System. Web. Hosting. HostingEnvironmentExceptIon: failed to access the IIS metadatabase.

The process account used to run ASP. NET must have read access to the IIS metabase (for example, IIS: // servername/W3SVC. For information about how to modify metadatabase permissions, see http://support.microsoft.com /? Kbid = 267904.

Source error:

An unhandled exception is generated during the execution of the current Web request. You can use the following exception stack trace information to determine the cause and location of the exception.
Stack trace:
[HostingEnvironmentExceptIon: failed to access the IIS metadatabase.]
  System. Web. Configuration. MetabaseServerConfig. MapPathCaching (String siteID, VirtualPath path) + 690  System. Web. Configuration. MetabaseServerConfig. System. Web. Configuration. IConfigMapPath. MapPath (String siteID, VirtualPath vpath) + 9
  System. Web. Hosting. HostingEnvironment. MapPathActual (VirtualPath virtualPath, Boolean permitNull) + 174
  System. Web. CachedPathData. GetConfigPathData (String configPath) + 398
  System. Web. CachedPathData. GetConfigPathData (String configPath) + 263
  System. Web. CachedPathData. GetVirtualPathData (VirtualPath virtualPath, Boolean permitPathsOutsideApp) + 166
  System. Web. Configuration. RuntimeConfig. GetLKGRuntimeConfig (VirtualPath path) + 187
--------------------------------------------------------------------------------
Version: Microsoft. NET Framework Version: 2.0.50727.42; ASP. NET version: 2.0.50727.42

 

This means that the current IIS Process on the server does not have the permission to access the metadatabase ...... I am bored, and. NET Framework2.0 is also installed. Should I be able to support. net? So Google, I found that there are more than one such problem. I read it because of IIS and. net Framework2.0 installation order reversed, Because I previously installed VisualStudio2005, so the system first installed. net Framework2.0. After IIS is installed ,.. net Framework is not registered with related components, so you cannot modify IIS!

 

Solution:

Go to C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727 and find a tool named aspnet_regiis.exe. The running method is as follows:
1. Start --> Run --> Enter cmd to run
2. After opening the DOS window, enter the above folder in the DOS window
3. Enter aspnet_regiis.exe-I-enable

 

Tested, everything is OK!

 

Ps: pay special attention to the installation sequence. Install IIS first and then install the. net Framework.:)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.