JsonServiceClient 似乎不包含在程序集中
本文关键字:程序 程序集 集中 包含 JsonServiceClient | 更新日期: 2023-09-27 18:32:04
在继续学习和使用ServiceStack的过程中,我正在尝试使用c#/WPF应用程序来使用hello service。
我已经完成了使用 NuGet 安装所需文件的预期步骤:
PM> install-package servicestack.common
我相信我已经导入了正确的命名空间:
using ServiceStack.Common;
using ServiceStack.Common.ServiceClient.Web;
然而,当我尝试遵循我在Stack和Github上找到的示例时,VS10报告找不到类型或命名空间。
var client = new JsonServiceClient("http://172.16.0.15/");
我也无法使用我认为是完全限定的名称创建此对象:
var client = new ServiceStack.ServiceClient.web.JsonServiceClient . . .
是否有必须安装的其他包或必须进行其他引用才能使用此类?
更新:
Darin建议的完全限定类型似乎不能解决问题:
var client = new ServiceStack.ServiceClient.Web.JsonServiceClient("http://172.16.0.15/");
我仍然收到VS10报告:
"The type or namespace name 'ServiceClient' does not exist in the namespace 'ServiceStack'.... "
正确的命名空间是:
using ServiceStack.ServiceClient.Web;
它不是:
ServiceStack.Common
它不是:
ServiceStack.Common.ServiceClient.Web
它不是:
ServiceStack.ServiceClient.web
因此,要么使用 using 关键字将正确的命名空间带入范围,要么完全限定类型:
var client = new ServiceStack.ServiceClient.Web.JsonServiceClient("http://172.16.0.15/");