Could not load file or assembly 'log4net,or one of its dependencies.

a 夏天 提交于 2019-12-13 08:49:10

问题


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

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)

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:


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-



来源:https://stackoverflow.com/questions/32460660/could-not-load-file-or-assembly-log4net-or-one-of-its-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!