【发布时间】:2018-10-15 03:17:58
【问题描述】:
我正在使用 Visual Studio 2017。我有一个引用 ServiceStack.Client.Core v5.1.0 的 Framework 4.6.1 控制台应用程序。它还在同一解决方案中引用了其他四个标准 2.0 DLL 项目,这些项目还引用了 ServiceStack.*.Core v5.1.0 程序集。所有 ServiceStack 包都是使用 NuGet 下载的。
我的控制台应用程序无法编译。尝试实例化 JsonServiceClient 的每一行代码都会引发几个编译时错误:
using (var client = new JsonServiceClient(AppSettings.BaseUri))
The type 'IMessageProducer' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
The type 'IJsonServiceClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
The type 'IServiceClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'ServiceStack.Interfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null'.
....
此解决方案中没有项目引用非 Core 5.1.0 ServiceStack 包。那么,为什么我会收到错误消息,要求我引用较旧的非核心 ServiceStack 程序集?
附录:如果我将所有 ServiceStack 包恢复到版本 5.0.2,那么它可以编译!
(可能与previous question有关)
【问题讨论】: