我正在使用 Xamarin Studio 5.5.2 和 GTK# 2.12 在 Windows 上开发 GTK# 应用程序。
每次我编译我的应用程序时,我都会收到 MSB3276 警告。在寻找解决方案时,我找到了这个 StackOverflow 线程:
warning MSB3276 - Found conflicts between different versions of the same dependent assembly
根据其他线程的指示,我使用 AsmSpy 检查问题出在哪里,我发现了一些非常奇怪的东西。我的应用程序引用了两个不同版本的 Mono.Cairo 库:
Reference: mscorlib
4.0.0.0 by ColorSharp
4.0.0.0 by MathNet.Numerics
4.0.0.0 by Newtonsoft.Json
4.0.0.0 by LightCreator
Reference: MathNet.Numerics
3.2.3.0 by ColorSharp
Reference: System.Numerics
4.0.0.0 by MathNet.Numerics
4.0.0.0 by Newtonsoft.Json
Reference: System
4.0.0.0 by MathNet.Numerics
4.0.0.0 by Newtonsoft.Json
4.0.0.0 by LightCreator
Reference: System.Core
4.0.0.0 by MathNet.Numerics
4.0.0.0 by Newtonsoft.Json
Reference: System.Data
4.0.0.0 by Newtonsoft.Json
Reference: System.Xml
4.0.0.0 by Newtonsoft.Json
Reference: System.Xml.Linq
4.0.0.0 by Newtonsoft.Json
Reference: System.Runtime.Serialization
4.0.0.0 by Newtonsoft.Json
Reference: gtk-sharp
2.12.0.0 by LightCreator
Reference: ColorSharp
0.2.1.20880 by LightCreator
Reference: gdk-sharp
2.12.0.0 by LightCreator
Reference: Mono.Cairo
4.0.0.0 by LightCreator // !!!!
2.0.0.0 by LightCreator // !!!!
Reference: Mono.Posix
2.0.0.0 by LightCreator
Reference: glib-sharp
2.12.0.0 by LightCreator
我一直在寻找解决方案,查看解决方案和项目属性、引用...但我找不到任何东西。
谁知道如何摆脱这个奇怪的问题?
提前谢谢你。
最佳答案
我也遇到了这个问题。事实证明,gtk-sharp.dll 和您在 GTK# 周围使用的其余程序集是引用 Mono.Cairo 2.0.0.0 编译的,所以当您在您的项目中引用它们,编译器也会提取这些引用。
这至少是奇怪的,因为 GTK# for windows 已经有一段时间没有发布 Mono.Cairo 2.0.0.0 了。希望 Xamarin 将在新版本中解决该问题。我目前正在使用 GTK# 2.12.38。
关于c# - 警告 MSB3276 - 奇怪的 Mono.Cairo 版本控制行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26463870/