Reputation: 584
In continuing to learn about and use ServiceStack, I'm trying to consume the hello service with a c#/WPF application.
I've gone through the expected step of using NuGet to install the required files:
PM> install-package servicestack.common
I believe I have imported the correct namespaces:
using ServiceStack.Common;
using ServiceStack.Common.ServiceClient.Web;
Yet when I attempt to follow the examples I've found on Stack and Github, VS10 reports that the type or namespace cannot be found.
var client = new JsonServiceClient("http://172.16.0.15/");
I am also unable create this object using what I believe to be the fully qualified name:
var client = new ServiceStack.ServiceClient.web.JsonServiceClient . . .
Is there another package that must be installed or another reference that must be made in order to use this class?
Update:
The fully qualified type as suggested by Darin doesn't seem to do the trick:
var client = new ServiceStack.ServiceClient.Web.JsonServiceClient("http://172.16.0.15/");
I still get VS10 reporting:
"The type or namespace name 'ServiceClient' does not exist in the namespace 'ServiceStack'.... "
Upvotes: 1
Views: 1839
Reputation: 1038810
The correct namespace is:
using ServiceStack.ServiceClient.Web;
It's not:
ServiceStack.Common
and it's not:
ServiceStack.Common.ServiceClient.Web
and it's not:
ServiceStack.ServiceClient.web
So either bring the correct namespace into scope with the using keyword or fully qualify the type:
var client = new ServiceStack.ServiceClient.Web.JsonServiceClient("http://172.16.0.15/");
Upvotes: 6