Postsharp get"模糊的装配绑定策略"错误

时间:2018-03-06 06:34:03

标签: unity-container prism postsharp prism-6

当我将 Postsharp (5.0.44)添加到我的某个项目中时,我在编译时遇到此错误,检查后我看到Postsharp有 Unity的问题(​​v4.0.30319 < / strong>),将Unity更新到版本5并解决了问题,但另一个问题是我的其他项目使用 Prism.Wpf(v6)而且这个lib与Unity v5不兼容,所以我现在陷入僵局。 实际上我在使用 Prism.Core(v6)之前得到了同样的错误(&#34;不明确的程序集绑定策略&#34;),但是用v7解决了。

因为我使用3个图书馆并且他们不能一起工作所以我不知道应该在哪里提出发行票,然后我会问是否有任何解决方法。

顺便说一句,我的项目使用 .Net Framework 4.6.1

这是完整日志

Severity    Code    Description Project File    Line    Suppression State
Error       Unhandled exception (postsharp-net40-x86-srv.exe release | .NET Framework 4.7.1): PostSharp.Sdk.CodeModel.BindingException: Ambiguous assembly binding policies: Assembly 'system.runtime, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' redirects both to 'system.runtime, version=4.1.2.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' and 'system.runtime, version=4.0.20.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a'.
   at PostSharp.Sdk.CodeModel.AssemblyBindingPolicyManager.EvaluatePolicy(IAssemblyName assemblyName, Boolean evaluateSystemPolicies)
   at PostSharp.Sdk.CodeModel.CompareExtensions.^4+F3cylo(IAssemblyName _0, IAssemblyName _1, AssemblyBindingPolicyManager _2, BindingOptions _3, Boolean _4)
   at PostSharp.Sdk.CodeModel.ModuleDeclaration.FindAssembly(IAssemblyName assemblyName, BindingOptions bindingOptions)
   at PostSharp.Sdk.CodeModel.ModuleDeclaration.^nQbUijLO(String _0, IAssemblyName _1, BindingOptions _2)
   at PostSharp.Sdk.CodeModel.ModuleDeclaration.FindType(Type reflectionType, BindingOptions bindingOptions)
   at PostSharp.Sdk.CodeModel.DeclarationCache.^pFnf8wEt()
   at PostSharp.Sdk.CodeModel.TypeRefDeclaration.get_TypeIdentifier()
   at PostSharp.Sdk.CodeModel.CompareExtensions.DefinitionMatchesReference(INamedType definition, INamedType reference, BindingOptions options)
   at PostSharp.Sdk.CodeModel.TypeRefDeclaration.^A9yFoe2uB3TC(ITypeSignature _0, BindingOptions _1)
   at PostSharp.Sdk.CodeModel.TypeRefDeclaration.MatchesReference(ITypeSignature reference)
   at PostSharp.Sdk.CodeModel.Collections.CustomAttributeDeclarationCollection.Contains(IType type)
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^SgrhoGlQ(AssemblyRefDeclaration _0)
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^+GwnKh4ZYHu3()
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.Execute()
   at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
   at PostSharp.Sdk.Extensibility.Project.Execute()
   at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
   at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation).

0 个答案:

没有答案