Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
We don’t allow you to modify the properties of the binding directly, but you can create a copy of the binding elements used to create a particular binding, alter the desired properties, then use the binding element collection to create a new custom binding.
BasicHttpBinding basicBinding = new BasicHttpBinding();
BindingElementCollection bindingElementCollection = basicBinding.CreateBindingElements();
bindingElementCollection.Find<HttpTransportBindingElement>().KeepAliveEnabled = false;
CustomBinding myBasicBinding = new CustomBinding(bindingElementCollection);