为什么我会收到此错误? Enterprise Library 4.1.0.0 异常处理日志记录跟踪
我们在应用程序中使用 Microsoft Enterprise Library 4.1.0.0 进行日志记录和跟踪。在一种情况下,我收到错误如下:
为异常处理创建配置节处理程序时发生错误:找到的程序集的清单定义与程序集引用不匹配。 (HRESULT 异常:0x80131040)。 (C:\Program Files\Datastream\Datastream Charting Add-In\Office2007\Thomson.Reuters.Datastream.Charting.ICAddInCore.dll.config 第 4 行)
下面是 ICAddInCore.dll.config 第 4 行:
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=8ef321d56661a4cd" />
请帮忙?
谢谢...
we are using Microsoft Enterprise Library 4.1.0.0 i our application for logging and tracing. In one case, I am getting error as:
An error occurred creating the configuration section handler for exceptionHandling: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040). (C:\Program Files\Datastream\Datastream Charting Add-In\Office2007\Thomson.Reuters.Datastream.Charting.ICAddInCore.dll.config line 4)
Below is the ICAddInCore.dll.config 4th line:
<section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=8ef321d56661a4cd" />
Kindly help?
Thank You...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它尝试加载的 DLL 版本与配置中的版本不匹配。
The version of the DLL it is trying to load does not match the version in the config.
您的 PublicKeyToken 似乎不正确。 Microsoft 提供的企业库 PublicKeyToken 是 31bf3856ad364e35。
您是自己构建和签署企业库还是使用不同版本的配置工具?或者可能是复制和粘贴错误?
如果您使用的是开箱即用的企业库,您的配置应该是:
如果您认为确实应该使用
PublicKeyToken=8ef321d56661a4cd
,那么您的项目可能引用了 Microsoft 签名版本的 Enterprise Library,因此您应该修复该引用。It looks like your PublicKeyToken is incorrect. The Microsoft supplied Enterprise Library PublicKeyToken is 31bf3856ad364e35.
Are you building and signing Enterprise Library your self or are you using a different version of the configuration tool? Or perhaps it's a copy and paste error?
If you are using out of the box Enterprise Library your config should be:
If you think you really should be using
PublicKeyToken=8ef321d56661a4cd
then your project is probably referencing a Microsoft signed version of Enterprise Library so you should fix that reference.有时问题并不完全在于错误消息显示的位置。我多次遇到这个错误,但我仍然不知道上次是如何解决的。我想我在重新启动 VS 后做了一个干净的构建。
Sometimes the issue is not exactly where the error message shows. I have encountered this error various times and I still don't know how I resolved it the last time. I think I did a clean build after restarting VS.