How do I disable reliable sessions in a named pipe binding?
Asked
Active
Viewed 2,930 times
2 Answers
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
-
Named pipes are ALWAYS support reliable sessions. – Rohit May 25 '10 at 12:16
-
Correct, and that's why i said you can't configure it – Vitalik May 25 '10 at 14:58