3rd party libraries refer to different versions of log4net.dll

后端 未结 2 1435
遇见更好的自我
遇见更好的自我 2020-12-15 21:13

I have two different libraries critical to my application that are dependent on different versions of log4net.dll. Trying both dll\'s in my bin folder give the usual error

相关标签:
2条回答
  • 2020-12-15 21:34

    This question might have some answers that will help you.

    Referencing 2 different versions of log4net in the same solution

    Alternatively, if it is Windsor's Logging Facility that is dependent on log4net and not Windsor itself, you might be able to write your own log4net abstraction based on the version of log4net used by the PayPal API and tell Windsor to use that instead.

    Here is the location of the log4net abstraction in Castle's source code repository: https://github.com/castleproject/Castle.Core/tree/master/src/Castle.Services.Logging.log4netIntegration

    I don't use Castle so I cannot tell you how to configure it to reference your own log4net abstraction, but I bet it is not too difficult (assuming it is possible).

    Here is a link to another post here on SO that describes configuring Castle with log4net. It also talks briefly about writing a custom logging logging facility:

    Logging with Castle.Facilities.Logging and log4net

    Good luck!

    0 讨论(0)
  • 2020-12-15 21:47

    Another route to go, I think, but I've never done it myself, is putting them in the GAC.

    I believe you can have different versions of the same dll in the GAC, and you should be ok.

    But I also might be crazy :)

    0 讨论(0)
提交回复
热议问题