0

Is there any way that we can use netnamedpipe binding with duplex ? I am getting the following error.

Contract requires Duplex, but Binding 'NetNamedPipeBinding' doesn't support it or isn't configured properly to support it.

       ServiceHost host = new ServiceHost(typeof(MyService));
        NetNamedPipeBinding npb = new NetNamedPipeBinding();
        npb.MaxBufferSize = Int32.MaxValue;
        npb.MaxReceivedMessageSize = Int32.MaxValue;
        npb.OpenTimeout = new TimeSpan(200000);
        npb.CloseTimeout = new TimeSpan(200000);
        npb.SendTimeout = new TimeSpan(200000);
        npb.TransferMode = TransferMode.Streamed;

        host.AddServiceEndpoint(typeof(IMyService), npb, "net.pipe://localhost/MyService");
        host.Open();  // I am getting above error here

Please guide me.

1 Answers1

1

Duplex communication works with a net named pipe binding. Try removing:

npb.TransferMode = TransferMode.Streamed;
JamesD
  • 440
  • 6
  • 16