Failed to access IIS metabase 完美解决

来源:互联网 发布:普通网民 阿里云能干嘛 编辑:程序博客网 时间:2024/06/11 10:25
“Failed to access IIS metabase”解决
2009-11-26 19:59

下午给一位同事装一个软件,装好后发现IIS版本太低,于是就想卸载了IIS重装,卸载一半突然想到这个软件需要注册码,而且很不容易得到,于是急忙停止卸载,可是打开服务管理一看,iis服务管理已经被卸载,无奈之下只好硬着头皮将旧版本的IIS卸载,重新安装了IIs6.0。装好后迫不及待运行程序,立即傻了眼,原来IIS中注册的默认网站中已经没了刚安装的软件。苦思冥想突然发现本来软件就是安装在:“programe file”目录下,IIS中的只是一个虚拟站点,于是建立虚拟目录……,浏览……浏览器中竟然空白,打开虚拟站点属性,发现没有选择net框架,选好framework2.0,再浏览……出现错误,终于放心了,出现错误就是成功的前兆,就怕什么都不显示,把错误代码放到网上搜索……,于是找到下面这篇文章,原来是IIS没有注册,回忆一下,安装Framewoek的时候要求先安装IIS,现在我卸载了IIS再安装,等于是现状Framework后安装IIS,怪不得没有注册,于是按照文章中的提示,一步步操作下来、……大功告成。心放到了肚里,头上的汗也消了。

浏览网站出现Failed to access IIS metabase错误,原因是IIS没有注册

解决办法:

在运行中键入CMD中进入目录C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727,运行aspnet_regiis

1、aspnet_regiis -ga administrator(administrator为当前用户)

2、aspnet_regiis -i (注册IIS)

3、iisreset /noforce (重启IIS,并非必须,可以在IIS服务管理中启动iis)

输入黑色的代码即可

操作详细:

C:/Documents and Settings/Administrator>cd c://windows//microsoft.net//framework//v2.0.50727

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regiis -ga administrator


Start granting administrator access to the IIS metabase and other directories us
ed by ASP.NET.
Finished granting administrator access to the IIS metabase and other directories
used by ASP.NET.

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regiis -lv


2.0.50727.0     Valid           C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/as
pnet_isapi.dll

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regiis -i


Start installing ASP.NET (2.0.50727).
..............
Finished installing ASP.NET (2.0.50727).

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>aspnet_regiis -lv


2.0.50727.0     Valid (Root)    C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/as
pnet_isapi.dll

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>iisreset /noforce

 

Attempting stop...
Internet services successfully stopped
Attempting start...
Internet services successfully restarted

C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727>

 

 

 

问题详情:

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.


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3591442
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +169
System.Web.CachedPathData.GetConfigPathData(String configPath) +389
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3536567
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189

原创粉丝点击