Represents the current stage in the lifecycle of a Task.
Assembly: mscorlib (in mscorlib.dll)
The task acknowledged cancellation by throwing an OperationCanceledException with its own CancellationToken while the token was in signaled state, or the task's CancellationToken was already signaled before the task started executing. For more information, see Task Cancellation.
The task has been initialized but has not yet been scheduled.
The task completed due to an unhandled exception.
The task completed execution successfully.
The task is running but has not yet completed.
The task is waiting to be activated and scheduled internally by the .NET Framework infrastructure.
The task has finished executing and is implicitly waiting for attached child tasks to complete.
The task has been scheduled for execution but has not yet begun executing.
The Task.Status property returns a member of the enumeration to indicate the task's current status.
The following example creates 20 tasks that will loop until a counter is incremented to a value of 2 million. When the first 10 tasks reach 2 million, the cancellation token is cancelled, and any tasks whose counters have not reached 2 million are cancelled. The example then examines the Task.Status property of each task to indicate whether the task has completed successfully or been cancelled. For those that have completed, it displays the value returned by the task.
Available since 8
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Available since 8.1