Export (0) Print
Expand All

AsyncTaskMethodBuilder::SetException Method

.NET Framework 4.6 and 4.5

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

Namespace:  System.Runtime.CompilerServices
Assemblies:   mscorlib (in mscorlib.dll)
  System.Threading.Tasks (in System.Threading.Tasks.dll)

public:
void SetException(
	Exception^ exception
)

Parameters

exception
Type: System::Exception

The exception to bind to the task.

ExceptionCondition
ArgumentNullException

exception is nullptr.

InvalidOperationException

The task has already completed.

-or-

The builder is not initialized.

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