ServiceBehaviorAttribute.UseSynchronizationContext Property

Gets or sets a value that specifies whether to use the current synchronization context to choose the thread of execution.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public bool UseSynchronizationContext { get; set; }
/** @property */
public boolean get_UseSynchronizationContext ()

/** @property */
public void set_UseSynchronizationContext (boolean value)

public function get UseSynchronizationContext () : boolean

public function set UseSynchronizationContext (value : boolean)

Not applicable.

Property Value

true if all calls to the service must run on the thread specified by the SynchronizationContext; otherwise, false. The default value is true.

Use this property to provide the user interface thread affinity that some applications require. For example, a Windows Forms application may be registered as a singleton service object. In this case, all calls into the service must run on the Windows Forms thread. The default case, in which UseSynchronizationContext is set to true, synchronizes all calls to the service to run on the thread captured from the System.Threading.SynchronizationContext.

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 Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: