System.Threading.Tasks.Task.RunSynchronously Method

Runs the System.Threading.Tasks.Task synchronously on the current System.Threading.Tasks.TaskScheduler.

Syntax

public void RunSynchronously ()

Remarks

A task may only be started and run only once. Any attempts to schedule a task a second time will result in an exception.

Tasks executed with Task.RunSynchronously will be associated with the current System.Threading.Tasks.TaskScheduler.

If the target scheduler does not support running this task on the current thread, the task will be scheduled for execution on the scheduler, and the current thread will block until the task has completed execution.

Requirements

Namespace: System.Threading.Tasks
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0