I recently started using WCF. I created a WCF service in a console program, and made that console program the service itself. It is being hosted as a Singleton as the program runs, in the following way:
var endPointUri = new Uri("http://127.0.0.1:13370/RuntimeService");
var host = new ServiceHost(this, endPointUri);
host.Open();
Notice how this
is being pointed as the instance. This works great, and my console application implements my IRuntimeService
just fine.
Now, here's the problem.
How do I add a service client for this service in another project in the solution? Right now, there's an issue in that I have to first start up the console application (for the service to be hosted), and THEN somehow add it in Visual Studio (or else it wouldn't be visible, right?). Same problem arises when I want to update the service.
Right now, as a workaround, I open up the compiled .EXE
file of the console application. Then, in my project, I update / add the service client while the .EXE
is running. However, that's not very smart in the long run, since I have several developers on this project, and I would like it to be somewhat automated (also because I have a build server that runs some unit tests and deploys the server as needed).
Is there any way that I can programmatically (maybe through commandline) update my WCF service client? Or even better, just update it while the service itself is not running?