I'm new to WCF, trying to learn the basics.
I've created a simple C# console application that self hosts (by using the ServiceHost class) a simple service.
Whenever i attempt to run it, i get an exception regarding namespace reservation.
I've found some command (netsh) to prevent this from happening, however i am wondering if this is a 开发者_JAVA百科must when self hosting a service?
I'd like to be able to deploy services ("agents") remotely on machines without doing massive amount of work, and be able to communicate with them.
If you do not have to ensure compatibility with existing clients, one workaround could be to use a different binding for your service. If you are not tied to http you could for example use net.tcp instead. This works without namespace reservation and does not require administrator privileges.
See this chart for the features provided by the different bindings
The short cut would be to run your servicehost width administrator privileges. Once you want to host your services live, you should consider hosting them using IIS
精彩评论