When using IIS, the problem of access to the IIS metadatabase encountered when configuring the ASP. NET platform is as follows:
Let's take a look at the problematic code:
| 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: An error occurred while accessing the IIS metabase.
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: An error occurred while accessing the IIS metabase.] 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 |
Problem Analysis:
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 (for later versions of. net, go to the relevant directory) 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