Task.FromCanceled<TResult> Method (CancellationToken)
.NET Framework (current version)
Creates a Task<TResult> that's completed due to cancellation with a specified cancellation token.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- cancellationToken
-
Type:
System.Threading.CancellationToken
The cancellation token with which to complete the task.
Type Parameters
- TResult
The type of the result returned by the task.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Cancellation has not been requested for cancellationToken; its IsCancellationRequested property is false. |
Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Available since 10
.NET Framework
Available since 4.6
Show: