• 解决"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)


    操作详细:

    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>

     方案二:
    可以建立一个的bat文件.以下为代码:

    @echo off
    pause
    aspnet_regiis -ga administrator
    aspnet_regiis -lv
    aspnet_regiis -i
    aspnet_regiis -lv
    iisreset /noforce
    @echo off
    pause


    将以上文本保存成bat文件.
    复制到C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727  后运行

    问题详情:

    [HostingEnvironmentException: Failed to access IIS metabase.]
       System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +637
       System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath) +9
       System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +174
       System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51
       System.Web.CachedPathData.GetConfigPathData(String configPath) +341
       System.Web.CachedPathData.GetConfigPathData(String configPath) +234
       System.Web.CachedPathData.GetApplicationPathData() +38
       System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +8802175
       System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +117

  • 相关阅读:
    【BZOJ4915】简单的数字题(数学)
    【BZOJ2140】稳定婚姻(匈牙利算法板子题)
    【BZOJ2739】最远点(决策单调性)
    【AT3526】[ARC082C] ConvexScore(贡献转化+容斥)
    【CF1264D2】Beautiful Bracket Sequence(组合数学)
    【洛谷2561】[AHOI2002] 黑白瓷砖(Polya定理)
    【洛谷3511】[POI2010] MOS-Bridges(混合图欧拉回路)
    【洛谷4226】避难所(构造)
    【洛谷7453】[THUSCH2017] 大魔法师(线段树+矩乘)
    【洛谷3207】[HNOI2010] 物品调度(置换问题)
  • 原文地址:https://www.cnblogs.com/Golf9527/p/1654186.html
Copyright © 2020-2023  润新知