1

How do I disable reliable sessions in a named pipe binding?

Rohit
  • 3,610
  • 7
  • 45
  • 76

2 Answers2

0

Before opening the host, set the Contract.SessionMode to SessionMode.Allowed when using a named pipe binding

// create a service host with a custom endpoint based on what we know
ServiceHost host = new ServiceHost(serviceHostType);
NetNamedPipeBinding binding = new NetNamedPipeBinding();

ServiceEndpoint ep = host.AddServiceEndpoint(contractName, binding, endpoint.Uri);
ep.Contract.SessionMode = SessionMode.Allowed;

wcfServices.Add(host);
host.Open();
j0k
  • 22,600
  • 28
  • 79
  • 90
0

Named Pipe doesn't support reliable session configuration. You'd need to create a custom binding.

More info at Reliable Sessions Overview

Vitalik
  • 2,724
  • 4
  • 32
  • 43