问题描述
我有两个关键的我的应用程序不同的库依赖于不同的版本log4net.dll的。试图既DLL在我的bin文件夹给当我使用第三方一块被称为平常错误:
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 when the 3rd party piece I'm using gets called:
无法加载文件或程序集log4net的,版本= 1.2 .10.0,文化=中性公钥= 1b44e1d426115821'或它的一个依赖。找到的程序集清单定义不匹配程序集引用。 (异常来自HRESULT:0x80131040)
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
有没有一种方法,应用程序可以引用dll的?第三方DLL的是温莎的IOC容器和PayPal的API,既能这个应用的关键。
Is there a way that the application can reference both dll's? The third party dll's are Windsor's IOC container and Paypal's API, both critical to this application.
推荐答案
这个问题可能有一些答案了会帮助你。
This question might have some answers that will help you.
的
替代地,如果它是温莎的日志记录工具是依赖于log4net的和不温莎本身,你可能能够基于PayPal的API使用的版本的log4net的编写自己的log4net的抽象,并告诉温莎使用该来代替。
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.
下面是log4net的抽象在城堡的源代码库的位置:
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
我不知道使用城堡所以我不能告诉你如何配置它以引用您自己的log4net的抽象,但我敢打赌,这是不是太困难的(假设它是可能的)。
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).
下面是链接到这里SO另一篇文章,描述与log4net的配置城堡。本文还简要谈到编写自定义日志记录工具:
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:
的
祝你好运!
这篇关于第三方库是指不同的版本log4net.dll的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!