代码之家  ›  专栏  ›  技术社区  ›  John

配置文件标记为重复的Exceptionless包

  •  2
  • John  · 技术社区  · 7 年前

    不确定我的项目发生了什么,但当我尝试运行它时,我收到了错误消息 Could not load file or assembly 'Exceptionless.Mvc' or one of its dependencies

    无可接受。MVC在我的项目中任何地方都没有被使用或引用,我甚至找不到任何带有Exceptionless的文本。。。。。。

    所以我使用Nuget Manager安装了exceptionless。MVC包。

    现在我得到了错误

    `HTTP Error 500.19 - Internal Server Error
    
    The requested page cannot be accessed because the related configuration data for the page is invalid.
    
    Config Error
    There is a duplicate 'exceptionless' section defined `
    

    安装exceptionless。Mvc在我的web配置中添加了以下内容

     <section name="exceptionless" type="Exceptionless.ExceptionlessSection, Exceptionless" />
     <exceptionless apiKey="API_KEY_HERE" />
      <modules runAllManagedModulesForAllRequests="true">
          <add name="ExceptionlessModule" type="Exceptionless.Mvc.ExceptionlessModule, Exceptionless.Mvc" />
        </modules>
    

    更新了包配置

      <package id="Exceptionless" version="4.2.1982" targetFramework="net45" />
    

    这是我项目中唯一引用exceptionsless/ExceptionsLessVC的地方。

    我对mvc exceptionless(无mvc例外)的功能或重复部分的位置感到困惑??

    有什么帮助吗?

    3 回复  |  直到 7 年前
        1
  •  1
  •   John    7 年前

    问题与IIS中存储的重复web配置文件有关。重命名该web配置后,原始配置可以优先删除任何重复的问题,但无例外。

        2
  •  0
  •   smoore4    7 年前

    您应该尝试删除处理程序,然后将其添加回。下面是一个类似的示例:

      <system.webServer>
        <handlers>
          <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
          <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
    

    您可能也需要注释掉这一部分。

     <section name="exceptionless".... 
    
        3
  •  0
  •   Ondrej Svejdar    7 年前

    网状物配置正在从Web继承。从父应用程序配置。此外,还有机器广域网。配置和计算机。配置。

    1) 如果您的应用程序位于IIS上,并且存在父应用程序,请检查web。父应用程序的配置

    2) 检查您的计算机广域网。配置和计算机。配置。 假设你在。NET 4.0及更高版本他们在这里: C: \ Windows \ Microsoft。NET\Framework\v4.0.30319\Config (适用于x32位应用程序池) C: \ Windows \ Microsoft。NET\Framework64\v4.0.30319\Config (用于x64位应用程序池)