ServiceStack.Interfaces中的System,Version = 4.0.0.0和System,Version = 2.0.5.0之间的冲突

use*_*170 3 .net c# 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".
Run Code Online (Sandbox Code Playgroud)

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

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
Run Code Online (Sandbox Code Playgroud)

看来ServiceStack.Interfaces是造成问题的原因,但我需要参考它。我在某种程度上引用错误吗?如何解决警告?

myt*_*thz 5

ServiceStack.Interfaces是一个普通的PCL库,仅使用System.Runtime.Serialization构建,它使用VS2017的新MSBuild格式引用。它没有明确引用任何版本,PCL构建会决定使用哪个版本。

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