关于log4net 1.2.11冲突的另一个问题 [英] Yet another issue about log4net 1.2.11 conflicts

查看:365
本文介绍了关于log4net 1.2.11冲突的另一个问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近2个小时,我一直在研究SO上的这些问题,但似乎没有任何效果.

I've spent the last 2 hours looking over these issues on SO, and nothing seems to be working.

我有一个通过NuGet使用log4net 1.2.11的解决方案.它可以在运行Windows 7的32位开发工作站上正常运行.不能在64位Windows 2008 R2测试系统上运行.我得到的错误是:

I have a solution that uses log4net 1.2.11, via NuGet. It works fine on my 32 bit development workstation running Windows 7. It does not run on my 64-bit Windows 2008 R2 test system. The error I get is:

未处理的异常:System.IO.FileLoadException:无法加载文件或程序集'log4net,版本= 1.2.11.0,区域性=中性,PublicKeyToken = 669e0ddf0bb1aa2a'或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

我正在测试系统上的应用程序目录中查找. log4net.dll文件的版本为1.2.11.

I am looking in the application directory on my test system. The log4net.dll file there is version 1.2.11.

GAC中的版本为1.2.10.我已将其删除.我的开发服务器上有一个版本,又是另一个版本.我也删除了.我已经重建了;我已经重新部署了.我已添加

The version in the GAC was version 1.2.10. I have removed it. There was a version on my development server that was yet again something else; I removed that as well. I have rebuilt; I have redeployed. I have added

<dependentAssembly>
    <assemblyIdentity name="log4net" publicKeyToken="669E0DDF0BB1AA2A" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-1.2.10.0" newVersion="1.2.11.0"/>
</dependentAssembly>

到我的配置文件.似乎没有什么区别.我的部署项目显示了正在部署的log4net程序集的正确版本和签名.

to my configuration file. Nothing seems to make a bit of difference. My deployment project shows the right version and signature of the log4net assembly that is being deployed.

我不知道还能做些什么,但是对于日志记录库阻止我的应用程序运行,我感到非常沮丧.

I do not know what else I can do, but I am getting quite frustrated that a logging library is preventing my application from running.

我错过了什么?

推荐答案

这是我的解决方案:我从log4net更改为Common.登录到NLog.并不需要付出很多努力,我认为这不是必需的,但是它奏效了,并且运行良好.

Here was my solution: I changed from log4net to Common.Logging to NLog. It didn't take a lot of effort, and I don't think it should have been necessary, but it worked, and worked well.

这篇关于关于log4net 1.2.11冲突的另一个问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆