How to disable reliable session in netNamedPipeBinding in WCF?
开发者_如何学JAVAHow do I disable reliable sessions in a named pipe binding?
Named Pipe doesn't support reliable session configuration. You'd need to create a custom binding.
More info at Reliable Sessions Overview
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();
精彩评论