Gets or sets an IInstanceProvider object that you can use to control the creation and destruction of service objects.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Implement the IInstanceProvider interface and assign the implementation to the property to control instances of the service type using a constructor other than the default constructor, for example, to implement a custom instancing mode such as instance pooling.
A service can also be configured to release an instance before the InstanceContext object is closed. This can be configured by using the ReleaseInstanceMode property or by calling the ReleaseServiceInstance method. If this is done, the InstanceContext object calls the ReleaseInstance method. If a new message arrives after the instance has been released, a new instance is created using the GetInstance method.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.