ASP.NET权限解决

来源:互联网 发布:软件开发是什么职业 编辑:程序博客网 时间:2024/06/05 00:55

 ASP.NET Error: Failed to access IIS metabase
This error showed up prior to the error "Mutex cannot be created" which I descirbed in my last post. I wrote down this to help other poor guys saving their poor time.
 
The more complete error message is as following:
 
Failed to access IIS metabase.
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).
 
The solution is still simple, execute this in command line:
 
aspnet_regiis -ga <user_name>
 
The aspnet_regiis.exe is under Windows/Microsoft.NET/v2.0.50727, and <user_name> should be replaced with your account to run the ASP.NET website. You can check it in your website properties dialog in IIS.
 
If it still doesn't work, you can try to do this as last step:
 
aspnet_regiis -i -enable
 
And then execute this to restart related services (usually W3SVC and IISADMIN):
 
net stop iisadmin
net start w3svc
 
If the problem is still here, I have no more ideas so far.

原创粉丝点击