我的 friend 给了我一个在 Xamarin Studio 中创建的项目。当我尝试运行该项目时,我收到一些与程序集引用冲突相关的警告。
我使用了 AsmSpy工具来检查哪些引用有冲突,我得到以下输出:
Detailing only conflicting assembly references.
Reference: Newtonsoft.Json
6.0.0.0 by Akavache <-- this one is Green
6.0.0.0 by Akavache.Sqlite3 <-- this one is Green
8.0.0.0 by MyAppName <-- this one is Red
Reference: Splat
1.6.0.0 by Akavache
1.6.0.0 by Akavache.Sqlite3
1.6.2.0 by MyAppName
我从未使用过 Xamarin Studio,我缺乏这方面的知识。如何更改引用以停止此警告?
最佳答案
您应该能够使用程序集重定向来“碰撞”所有程序集以使用特定版本。
(您需要相应地更新名称、公钥和版本)
<dependentAssembly>
<assemblyIdentity name="Akavache" publicKeyToken="1234567890" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
这些需要在运行时节点的 *.config 文件中;
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
关于c# - 更改冲突的程序集引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35987844/