C # Reference DLL version conflict

Source: Internet
Author: User
Tags log4net

Resolved, download the old key version on the official website, and then redirect.

Manual reference to two versions of DLL error is due to my publickeytoken case (unexpectedly not verified ~ ~)

But I do not understand that if the reliance on a lot of words, even the PublicKeyToken are not unified, it will not be very difficult to manage it?

The following is the original problem content:

Zookeeper is used in the project, he relies on a lower version of log4net, but I want to use the higher version of the log4net.

Baidu later found that you can use the redirect assembly version to solve, but the practice found that two versions of PublicKeyToken is not the same!

What should I do about this? Can you just pull the code to regenerate one?

Try manually referencing two versions of the DLL, one with an alias.

Add dependentassembly in app. Config

  <dependentAssembly>      <assemblyIdentity name="log4net" publicKeyToken="1b44e1d426115821" culture="neutral" />    ??<codeBase version="1.2.10.0" href="DLL/log4net_1.2.10.dll" />  </dependentAssembly>  <dependentAssembly>    ??<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />    ??<codeBase version="2.0.8.0" href="DLL/log4net_2.0.8.0.dll" />  </dependentAssembly>

Compile Time report:

Warning MSB3243: Unable to resolve "log4net, version=2.0.8.0, Culture=neutral,
PUBLICKEYTOKEN=669E0DDF0BB1AA2A "and" Log4net, version=1.2.10.0,
Culture=neutral, publickeytoken=1b44e1d426115821 "the conflict between. are at liberty to choose "Log4net,
version=2.0.8.0, Culture=neutral, publickeytoken=669e0ddf0bb1aa2a ".

Launch report:


C # Reference DLL version conflicts >> CSharp

The answer is quite clear:
Http://www.goodpm.net/postreply/csharp/1010000008923000/C References DLL version conflict. html

C # Reference DLL version conflict

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.