InstanceContextMode.Single Field

Definition

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.

Single
Field Value

Remarks

Note

For singleton lifetime behavior (for example, if the host application calls the ServiceHost constructor and passes an object to use as the service), the service class must set InstanceContextMode to Single, or an exception is thrown when the service host is opened.

Applies to