And*_*ris 2 castle-windsor castle moq
在我的项目中,我需要同时使用Castle.Windsor和Moq dll.Windsor要求Castle.Core也在项目中引用.
当我尝试使用Castle.Core中的方法时问题开始:
Castle.DynamicProxy.Generators.AttributesToAvoidReplicating.Add(...);
问题1: 如果我使用NET40文件夹中的Moq.dll,我得到了错误"类型'Castle.DynamicProxy.Generators.AttributesToAvoidReplicating'存在于'...\Windsor\dotNet40\Castle.Core.dll'和'..\MOQ\NET40\Moq.dll'"
问题2: 如果我使用"NET40-RequiresCastle"文件夹中的Moq.dll,这在逻辑上是我的情况,我得到版本冲突 - Moq.dll使用Castle.Core,Version = 2.5.0.0,但Windsor使用Castle.Core,Version = 2.5.1.0
使用程序集绑定可以解决问题 - App.config:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" />
<bindingRedirect oldVersion="1.0.0.0-2.5.0.0" newVersion="2.5.1.0" />
</dependentAssembly>
</assemblyBinding>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1758 次 |
| 最近记录: |