Assembly: System.ServiceModel (in system.servicemodel.dll)
|PerCall||A new InstanceContext object is created prior to and recycled subsequent to each call. If the channel does not create a session this value behaves as if it were PerCall.|
|PerSession||A new InstanceContext object is created for each session.|
|Single||Only one InstanceContext object is used for all incoming calls and is not recycled subsequent to the calls. If a service object does not exist, one is created. |
The System.ServiceModel.InstanceContext manages the association between the channel and the user-defined service objects. Use the InstanceContextMode enumeration with the ServiceBehaviorAttribute.InstanceContextMode property to specify the lifetime of the InstanceContext object. Windows Communication Foundation (WCF) can create a new InstanceContext object for every call, every session or specify that the InstanceContext object is bound to a single service object. For a working example, see the Instancing Sample.
The Single value specifies that a single InstanceContext object should be used for the lifetime of the service.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.