Export (0) Print
Expand All

AsyncTaskMethodBuilder(TResult).SetException Method

.NET Framework 4.5

Marks the task as failed and binds the specified exception to the task.

Namespace:  System.Runtime.CompilerServices
Assembly:  mscorlib (in mscorlib.dll)

member SetException : 
        exception:Exception -> unit

Parameters

exception
Type: System.Exception

The exception to bind to the task.

ExceptionCondition
ArgumentNullException

exception is a null reference (Nothing in Visual Basic).

InvalidOperationException

The task has already completed.

This type and its members are intended for use by the compiler.

.NET Framework

Supported in: 4.6, 4.5

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Show:
© 2015 Microsoft