Task::Start Method (TaskScheduler^)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Starts the Task, scheduling it for execution to the specified TaskScheduler.

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

public:
void Start(
	TaskScheduler^ scheduler
)

Parameters

scheduler
Type: System.Threading.Tasks::TaskScheduler^

The TaskScheduler with which to associate and execute this task.

Exception Condition
ArgumentNullException

The scheduler argument is null.

InvalidOperationException

The Task is not in a valid state to be started. It may have already been started, executed, or canceled, or it may have been created in a manner that doesn't support direct scheduling.

ObjectDisposedException

The Task instance has been disposed.

TaskSchedulerException

The scheduler was unable to queue this task.

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

For information on handling exceptions thrown by task operations, see Exception Handling (Task Parallel Library).

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: