c# - ServiceStack.Interfaces 中系统版本=4.0.0.0 与系统版本=2.0.5.0 之间的冲突

标签 c# .net servicestack

我正在尝试解决构建警告,但我无法克服这个问题。我的目标是 .Net 4.6.2,但 ServiceStack.Interfaces 似乎是针对较低版本?在详细输出中:

There was a conflict between "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes".
1>      "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it was primary and "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" was not.
1>      References which depend on "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll].
1>          C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll
1>            Project file item includes which caused reference "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\System.dll".

接着是很多看起来不错的常规程序集,然后是冲突:

1>      References which depend on "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" [].
1>          C:\Code\Trunk\packages\ServiceStack.Interfaces.4.5.6\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll
1>            Project file item includes which caused reference "C:\Code\Trunk\packages\ServiceStack.Interfaces.4.5.6\lib\portable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10\ServiceStack.Interfaces.dll".
1>              ServiceStack.Common, Version=4.5.6.0, Culture=neutral, processorArchitecture=MSIL
1>              ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL
1>              ServiceStack.Redis, Version=4.5.6.0, Culture=neutral, processorArchitecture=MSIL

看来是 ServiceStack.Interfaces 导致了问题,但我需要引用它。我以某种方式引用它是错误的吗?我该如何解决警告?

最佳答案

ServiceStack.Interfaces 是一个普通的 PCL 库,它是用 System.Runtime.Serialization 构建的它引用使用 VS2017 的新 MSBuild 格式。它没有 explicitly reference any version , PCL 构建决定它使用的版本。

一旦 .NET Standard 2.0 和 .NET Core 2.0 发布,我们将在 ServiceStack 的主要 v5 版本中将 .NET Standard 库合并到主要的 ServiceStack NuGet 包中,它将用 .NET Standard 替换 PCL 库,这将解决此警告,但在进行任何结构更改之前,我们需要等待 v5。

关于c# - ServiceStack.Interfaces 中系统版本=4.0.0.0 与系统版本=2.0.5.0 之间的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44643912/

相关文章:

c# - C# 应用程序与 unix c++ 应用程序通信的最佳方式是什么

c# - 你如何在 Ruby 中实现多态性?

asp.net - 如何在 Visual Studio 中写入输出

servicestack - 使用 ServiceStack 和 ORMLite SQLServer 进行审计跟踪

nginx - ServiceStack Docker 架构

c# - 我可以从服务堆栈中的自定义用户 session 中访问 Web 服务吗?

C# - 使用 .ashx 文件加载远程图像并发送到浏览器

c# - 为什么我不能修改拆箱转换的结果?

c# - 是否支持在 .Net Framework 中使用 C# 的 POP3 客户端?

c# - 如何以编程方式从动态 JObject 中删除属性