无法加载文件或程序集'log4net,或其依赖项之一. [英] Could not load file or assembly 'log4net,or one of its dependencies.

查看:337
本文介绍了无法加载文件或程序集'log4net,或其依赖项之一.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为log4net版本1.2.0.13安装了Easygelf.log4net软件包,但出现错误

I installed Easygelf.log4net package for log4net version 1.2.0.13 but I am getting error

无法加载文件或程序集'log4net,版本= 1.2.13.0, 文化=中性,PublicKeyToken = 669e0ddf0bb1aa2a'或其中之一 依赖关系.找到的程序集的清单定义不 匹配程序集参考. (来自HRESULT的异常:0x80131040)

Could not load file or assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

我尝试将以下内容添加到web.config中,但没有运气

I tried adding the below to the web.config but no luck

<dependentAssembly>
        <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.2.13.0" newVersion="1.2.13.0" />
      </dependentAssembly>

推荐答案

检查项目中引用的程序集版本,并相应地更改旧版本和新版本. 我也遇到了同样的错误,我的项目正在使用1.2.15.0.所以我更改了程序集映射信息-

Check assembly version that is referenced in the project and change old version and new version accordingly. I was also getting same error, and my project was using 1.2.15.0 . so I changed assembly mapping information-

这篇关于无法加载文件或程序集'log4net,或其依赖项之一.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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