Run Method (Func(Task))

Task.Run Method (Func<Task>)

.NET Framework 4.6 and 4.5

Queues the specified work to run on the thread pool and returns a proxy for the task returned by function.

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

public static Task Run(
	Func<Task> function


Type: System.Func<Task>

The work to execute asynchronously

Return Value

Type: System.Threading.Tasks.Task

A task that represents a proxy for the task returned by function.

Exception Condition

The function parameter was null.

For information on handling exceptions thrown by task operations, see Exception Handling (Task Parallel Library).

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
© 2015 Microsoft