发现Xamarin中相同依赖程序集的不同版本之间存在冲突

时间:2018-02-22 22:45:21

标签: c# visual-studio xamarin xamarin.ios

编译时收到以下警告消息:

/Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190. (MSB3276) (mobile.iOS)

我正在使用Visual Studio Community 2017 for Mac版本7.3.3(版本23)和Xamarin。

当我查看详细的构建输出时,我可以看到以下几行:

Target ResolveAssemblyReferences:
    Consider app.config remapping of assembly "System.Net.Http, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.0.0" [/Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/gac/System.Net.Http/4.0.0.0__b03f5f7f11d50a3a/System.Net.Http.dll] to Version "4.0.0.0" [/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Net.Http.dll] to solve conflict and get rid of warning.
    /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2003,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.

我知道警告不是错误,但无论如何我想解决它,因为它不是一件好事。

1 个答案:

答案 0 :(得分:0)

就我而言,这是因为我正在使用两个使用同一库的不同程序集的软件包。