System, Version=4.0.0.0 和 System, Version = 2.0.5.0 in Servi

  • 本文关键字:System Version in Servi 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 AssembliesMicrosoftFramework.NETFrameworkv4.6.2System.dll].
1>          C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.6.2System.dll
1>            Project file item includes which caused reference "C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.6.2System.dll".
然后

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

1>      References which depend on "System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" [].
1>          C:CodeTrunkpackagesServiceStack.Interfaces.4.5.6libportable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10ServiceStack.Interfaces.dll
1>            Project file item includes which caused reference "C:CodeTrunkpackagesServiceStack.Interfaces.4.5.6libportable-wp80+sl5+net45+win8+wpa81+monotouch+monoandroid+xamarin.ios10ServiceStack.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 格式引用。它不显式引用任何版本,PCL 生成决定它使用的版本。

一旦.NET Standard 2.0和.NET

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

相关内容

  • 没有找到相关文章