我通过nuget将Exceptionless添加到我的WebForms应用程序中。应用程序编译但访问页面时出现运行时错误:
无法加载文件或程序集'Exceptionless.Portable,Version = 3.1.1416.0,Culture = neutral,PublicKeyToken = fc181f0a46f65747'或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。 (HRESULT异常:0x80131040)
问题是3.1.1416.0
。它不应该尝试加载此版本,因为我目前正在使用版本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
。所有版本均为3.2.1424.0
。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.
有什么想法?感谢。
答案 0 :(得分:0)
这是您第一次使用它还是一次使用3.1.1416.0
并升级到3.2.1424.0
?如果是这样,您可能需要清除或手动擦除bin
文件夹。如果没有,请尝试设置新的解决方案,安装Exceptionless,执行最低可行性测试以确保其正常工作,并在现有项目中使用这些程序集。