WCF "no endpoint listening" error with named pipes

I am using WCF with .NET 3.5 I am using named pipes but keep getting error

There was no listening to net.pipe endpoints: // localhost / A test that can receive a message. This is often caused by an invalid address or SOAP action.

I followed the tutorial http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication , but the problem remains. The endpoints on both the client and the server are the same (I checked spelling, etc.). There is no configuration file for this project, but it is in the code.

EDIT: Code (client):

  ChannelFactory<ITest> pipeFactory =
    new ChannelFactory<ITest>(
    new NetNamedPipeBinding(),
    new EndpointAddress(
    "net.pipe://localhost/test"));

       ITest test= pipeFactory.CreateChannel();

            test.doStuff();

SERVER:

        serviceHost = new ServiceHost(typeof(Test), new Uri("net.pipe://localhost"));

        serviceHost.AddServiceEndpoint(typeof(ITest), new NetNamedPipeBinding(), "test");

        File.Create(@"C:\test.txt");

        serviceHost.Open();

thank

+3
source share
3 answers

ServiceHost. :

serviceHost = new ServiceHost(typeof(Test));
serviceHost.AddServiceEndpoint(typeof(ITest), new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/test"));
File.Create(@"C:\\test.txt");
serviceHost.Open();
+4

:

  • Windows, .
  • , console.readline,
  • , localhost .
+1

, , net.pipe URL- (.. http://localhost:1234/MyService/etc/), , Net.Pipe Listener Adapter Windows Service. ( Net.Tcp Listener Adapter)

The service does not seem to be enabled or running in some scenarios, especially when deployed to a remote server, which may not have had a large number of development tools installed that actively use these services. Starting the service fixed the problem.

0
source

All Articles