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

标签 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.

我知道警告不是错误,但我还是想解决它,因为这不是一件好事。

最佳答案

在我的例子中,我认为这是因为我使用的是两个使用同一库的不同程序集的包。

关于c# - 在 Xamarin 中发现同一依赖程序集的不同版本之间存在冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48938469/

相关文章:

visual-studio - 对于 Visual Studio 2010 上 TFS 2008 中的所有冲突,我如何处理 "Take Source Branch Version"?

ios - iPhone - 一个 View 中的多个表

ios - Xamarin.iOS-无法安装软件包'System.Net.Http 4.0.0',该软件包不包含任何程序集引用

c# - MSMQ:MessageQueue.Close() 在 .EndReceive() 处抛出异常 -1073741536

git - 如何在 Visual Studio 2019 中 fork 本地 git 存储库?

javascript - 如何在 GeckoFX C# 中禁用 WebRTC

visual-studio - 将权限提升到 Visual Studio 以获取构建后事件批处理脚本

c# - Xamarin Android 中选项卡更改前的验证

c# - 将 C++ .lib 和 .h 文件导入 C# 项目?

c# - 我可以告诉 MVC 自动将 pascal-cased 属性分成单词吗?