This ought to be easy, but I haven't found a way to do it. I need to launch a WCF server in such a way that if an instance is already running, it will kill the running one first.
Of course, by attempting to launch the server a second time, it will throw an exception that I can catch. But I don't know how to actually shut down the running instance. I could send it a shut-down message, but that will work only if the server responds correctly. I want a way to do it unilaterally.
I'm using C# 4.0 / VS 2010.