I want to run two instance of my program on my machine.
Each instance needs localhost named pipe:
_host = new ServiceHost(typeof(ManagementConsole),
new Uri[]
{
new Uri("net.pipe://localhost")
});
_host.AddServiceEndpoint(typeof(IManagementConsole),
new NetNamedPipeBinding(),
"PipeManagementConsole");
_host.Open();
In another instance of my program I use PipeManagementConsole2
So clients supposed to used net.pipe://localhost/PipeManagementConsole and net.pipe://localhost/PipeManagementConsole2.
However Windows doesn’t allow second instance of my program to run, it claims that net.pipe://localhost is already in use (and it is), how can I fix this issue?
different address should be specified when creating ServiceHost, not when calling AddServiceEndpoint.
This code works fine:
Clients should use
"net.pipe://localhost/2/PipeManagementConsole"But this code doesn’t work:
if
net.pipe://localhost/PipeManagementConsoleis already in useI don’t know why
net.pipe://localhost/2/PipeManagementConsoleis better thannet.pipe://localhost/PipeManagementConsole2