Partager via


TaskCanceledException.Task Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets the task associated with this exception.

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

Syntax

'Declaration
Public ReadOnly Property Task As Task
public Task Task { get; }

Property Value

Type: System.Threading.Tasks.Task
A reference to the Task that is associated with this exception.

Remarks

It is permissible for no Task to be associated with a TaskCanceledException, in which case this property will return null.

This property is thread-safe and may be used from multiple threads concurrently.

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.