Gets or sets a value that indicates when in the course of an operation invocation to recycle the service object.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Use the InstanceContextMode value. Setting the property changes that default behavior.property to specify when Windows Communication Foundation (WCF) recycles a service object in the course of executing a method. The default behavior is to recycle a service object according to the
In transaction scenarios, the ReleaseServiceInstanceOnTransactionComplete property to true.property is often used to ensure that old data associated with the service object is cleaned up prior to processing a method call. You can also ensure that service objects associated with transactions are recycled after the transaction successfully completes by setting the
You can choose the following behaviors:
Recycle a service object before an operation is called.
Recycle a service object after an operation is called.
Recycle a service object both before and after an operation is called.
No recycling behavior.
You can also use OperationBehaviorAttribute to configure a callback contract operation in a duplex client application. When used on a callback operation, the property must be None or an InvalidOperationException exception is thrown at runtime.
In addition, it is important to realize that if the service is created by passing a service object to the ServiceHost.ServiceHost(Object, Uri) constructor, the value of this property is treated as if it were None.
Available since 3.0