Author: Yang youshan
Address: http://blog.csdn.net/yysyangyangyangshan/article/details/20310739
When debugging the asp.net program today, the program was released, but when added to the ISS virtual directory, an error is always reported during browsing:
Exception details: System. Web. Hosting. HostingEnvironmentException: An error occurred while accessing the IIS metadatabase. solution:
An error occurred while accessing the IIS metadatabase.
Similarly, this command can also be used to grant IIS operation permissions to new users in the operating system.
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.
Check and try again. The following method can be used to solve the problem.
Solution: Take the. net framework 2.0 environment as an example. If the website version is another version.
Step 1:
1. Start --> Run --> Enter cmd;
2. Go down to the cd file name and enter
C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727Directory, that is, the installation directory of your environment, or another disk, to see where you put the installation, to the specified directory;
3. Input
Aspnet_regiis.exe-I-enable
Step 2:
Enter
Aspnet_regiis-ga aspnet
For example
You can.