Compatibility between Common. Logging and log4net component versions

Source: Internet
Author: User
Tags log4net

Recently, I used the ILog interface of Common. Logging as a log interface. At the same time, I used its log4net adapter and log4net recorder to record system logs. I encountered a log4net version problem during use.

Install the package in project component management:

PM> Install-Package Common. Logging

PM> Install-Package Common. Logging. Log4Net [2.0.1 version; dependent on Common. Logging (≥2.0.0); log4net (= 1.2.10 )]

Log4net. the dll version is 1.2.10.0. In this matching version, the following error occurs: {"Unable to create type' Common. logging. log4Net. log4NetLoggerFactoryAdapter, Common. logging. log4net '"}

An error occurred while upgrading the log4net component to the latest version 1.2.13. Install-Package: An error occurred while updating "log4net 1.2.10" to "log4net 2.0.3. "Common. Logging. log4net" compatible with "Log4Net 2.0.3" cannot be found.

 

Delete Common. Logging. Log4Net and reinstall the following versions.

PM> Install-Package Common. Logging. Log4Net1211 [2.2.0 version; Common. Logging (≥2.0.0); Log4Net (≥1.2.11 )]

In the project, the log4net. dll version is 1.2.11.0, run OK, upgrade log4net1.2.13, and run OK;

Note the differences in assembly file names in the configuration file

 

Version redirection

 


This is mainly because log4net version 1.2.11 is different from the publicKeyToken of 1.2.10. You can use the VS tool SN-T component file name. dll to view the public key.

The public key of log4net (≥1.2.11) is marked as 669e0ddf0bb1aa2a

The public key of log4net (= 1.2.10) is marked as 1b44e1d1_115821.

 

Http://www.nuget.org/packages/Log4Net/

Http://www.nuget.org/packages/Common.Logging/

Http://www.nuget.org/packages/Common.Logging.Log4Net1211/

Http://www.nuget.org/packages/Common.Logging.Log4Net/

Http://developer.3l.nl/post/16463925249/log4net-1-2-11-dependency-hell

Related Article

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.