有使用过VS2003的朋友都应该知道,在安装VS之前,一般需要先安装IIS,这样在安装后.net frameworks之后不会有权限问题.
我自从用VS2005后,由于自带的DevelopmentServer比较方便,因此常常忘记装IIS,今天因为突然需要在IIS下部署,临时装了IIS,理所当然的出现了权限问题:
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). For information on modifying
metabase permissions, please see http://support.microsoft.com/?kbid=267904.
很显然是由于.NET的帐户没有足够的权限来访问IIS
解决方案如下:1)>aspnet_regiis -ga <account>
2)>aspnet_regiis -i
上面的account是.net的用户名,如果在XP下,用Users即可.