我正在通过 nuget 将 Exceptionless 添加到我的 WebForms 应用程序中。应用程序编译,但访问页面时出现运行时错误:
无法加载文件或程序集 'Exceptionless.Portable, Version=3.1.1416.0, Culture=neutral, PublicKeyToken=fc181f0a46f65747' 或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)
问题是3.1.1416.0
。它不应该尝试加载此版本,因为我目前正在使用 version 3.2.1424.0
。我检查了 web.config 并且不存在运行时重新分配。
我的 web.config 文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="exceptionless" type="Exceptionless.ExceptionlessSection, Exceptionless.Extras" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
....
<exceptionless apiKey="***********" enabled="true" />
....
<system.webServer>
<modules>
<add name="ExceptionlessModule" type="Exceptionless.Web.ExceptionlessModule, Exceptionless.Web" />
</modules>
</system.webServer>
</configuration>
我的申请从哪里领取 3.1.1416.0
?
- 已检查
web.config
(见上文) - 所有无异常引用程序集的检查版本:
Exceptionless.Extras
,Exceptionless.Portable
,Exceptionless.Web
. 都在 version3.2.1424.0
。 - 检查 IISExpress 配置文件
applicationhost.config
,redirection.config
,aspnet.config
- 为版本号完成了“在文件中搜索”(*.*) - 没有!
程序集加载跟踪如下(如您所见,仅指错误的程序集版本:
=== Pre-bind state information ===
LOG: DisplayName = Exceptionless.Portable, Version=3.1.1416.0, Culture=neutral, PublicKeyToken=fc181f0a46f65747
(Fully-specified)
LOG: Appbase = file:///C:/TFS/DALS/Main/Source/Core/StaffPages/
LOG: Initial PrivatePath = C:\TFS\DALS\Main\Source\Core\StaffPages\bin
Calling assembly : DerbyLib, Version=2.2.5855.29039, Culture=neutral, PublicKeyToken=cfdbfaae31cae294.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\TFS\DALS\Main\Source\Core\StaffPages\web.config
LOG: Using host configuration file: C:\Users\Chris\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Exceptionless.Portable, Version=3.1.1416.0, Culture=neutral, PublicKeyToken=fc181f0a46f65747
LOG: Attempting download of new URL file:///C:/Users/Chris/AppData/Local/Temp/Temporary ASP.NET Files/vs/ec9388cd/d1727d5c/Exceptionless.Portable.DLL.
LOG: Attempting download of new URL file:///C:/Users/Chris/AppData/Local/Temp/Temporary ASP.NET Files/vs/ec9388cd/d1727d5c/Exceptionless.Portable/Exceptionless.Portable.DLL.
LOG: Attempting download of new URL file:///C:/TFS/DALS/Main/Source/Core/StaffPages/bin/Exceptionless.Portable.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
有什么想法吗?谢谢。