Server Error in '/accident' Application.

    今天考虑到有点时间,想把之前的几个IIS问题记录下,之前都没有遇到这样的问题,是前几天去客户那里配置应用程序时候出现的。

    客户系统:XP系统,和我经常用的优点差别,

   

    开始配置应用程序:安装IIS信息服务器,安装成功;安装NET2.0框架,安装几分钟后,提示之前已经装过NET2.0框架,就没再安装了;配置编译好的应用程序,在地址栏中中输入网址,就出现了上面的问题。

 

 

    错误的详细信息:Server Error in '/accident' Application.
--------------------------------------------------------------------------------

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) +3492170
   System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
   System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
   System.Web.CachedPathData.GetConfigPathData(String configPath) +382
   System.Web.CachedPathData.GetConfigPathData(String configPath) +243
   System.Web.CachedPathData.GetApplicationPathData() +68
   System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
   System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

 

   之后再网上查了下,都说是IIS没有注册或则 没有给ASPNET帐户运行权限,网上都有解决方案,按照步骤,问题最后解决啦

    网上解决方案:在公司里的某台电脑发现(asp.net)Failed to access IIS metabase这样的情况,经过一番折腾,发现原因可能有两个:
  1.没有给ASPNET帐户运行权限(The current problem is caused by settings of permission for ASPNET account in IIS admin object)。
  2.先安装了vs.net 2005 再安装IIS。

  有几种解决方案,首先进行了如下尝试:

  Step1.打开开始菜单程序组里Microsoft .NET Framework SDK v2.0下的SDK Command Prompt,即SDK命令行终端。

  Step2.运行下面的命令: aspnet_regiis –ga ASPNET,然后重启IIS服务,但是问题依旧。


  建议重新安装SDK2.0。于是在刚才的命令窗口执行如下命令:

  aspnet_regiis –u

  将已安装的SDK卸载,然后再运行aspnet_regiis –i,重新安装SDK2.0。重新启动IIS服务(此步骤不知是否必须),运行我的程序,问题解决!

  从上面的问题出现到解决的过程来看,出现这种问题的原因可能是因为先于安装IIS之前安装VS2005。所以建议以后大家如果做在.Net Framework 2.0下面做Web开发,最好先安装IIS,再安装VS2005或SDK2.0

  

     应该是就是上面说的问题,客户机上已经安装了NET2.0,在安装IIS就会出现问题。

 

     .NET Framework 工具

     ASP.NET IIS 注册工具 (Aspnet_regiis.exe)

 

在一台计算机上并行执行多个 .NET Framework 版本时,映射到 ASP.NET 应用程序的 ASP.NET ISAPI 版本决定了该应用程序所使用的公共语言运行库 (CLR) 版本。使用 ASP.NET IIS 注册工具 (Aspnet_regiis.exe),管理员或安装程序可以方便地更新 ASP.NET 应用程序的脚本映射,使其指向与该工具关联的 ASP.NET ISAPI 版本。该工具还可以用于显示所有已安装的 ASP.NET 版本的状态,注册与该工具耦合的 ASP.NET 版本,创建客户端脚本目录,以及执行其他配置操作。

     aspnet_regiis -i(注册IIS)

  

    安装与 Aspnet_regiis.exe 关联的 ASP.NET 版本,并更新 IIS 元数据库根目录和根目录下的脚本映射。

只更新使用早期 ASP.NET 版本的应用程序的脚本映射。使用新版本的应用程序不受影响。

 

  aspnet_regiis -u

 

从计算机中卸载与 ASP.NET IIS 注册工具关联的 ASP.NET 版本。此 ASP.NET ISAPI 版本的现有脚本映射自动重新映射到其余已安装的 ASP.NET ISAPI 的最新版本。

 

 iisreset /noforce (重启IIS)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值