Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TaskContinuationOptions Enumeration

Specifies the behavior for a task that is created by using the Task.ContinueWith or Task(Of TResult).ContinueWith method.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

'Declaration
<SerializableAttribute> _
<FlagsAttribute> _
Public Enumeration TaskContinuationOptions

Member nameDescription
Supported by Portable Class LibrarySupported in .NET for Windows Store appsAttachedToParentSpecifies that a task is attached to a parent in the task hierarchy. By default, a child task (that is, an inner task created by an outer task) executes independently of its parent. You can use the TaskContinuationOptions.AttachedToParent option so that the parent and child tasks are synchronized. For more information, see Attached and Detached Child Tasks.
Supported in .NET for Windows Store appsDenyChildAttachSpecifies that an InvalidOperationException will be thrown if an attempt is made to attach a child task to the created task.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsExecuteSynchronouslySpecifies that the continuation task should be executed synchronously. With this option specified, the continuation will be run on the same thread that causes the antecedent task to transition into its final state. If the antecedent is already complete when the continuation is created, the continuation will run on the thread creating the continuation. Only very short-running continuations should be executed synchronously.
Supported in .NET for Windows Store appsHideSchedulerPrevents the ambient scheduler from being seen as the current scheduler in the created task. This means that operations like StartNew or ContinueWith that are performed in the created task will see Default as the current scheduler.
Supported in .NET for Windows Store appsLazyCancellationIn the case of continuation cancellation, prevents completion of the continuation until the antecedent has completed.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsLongRunningSpecifies that a task will be a long-running, course-grained operation. It provides a hint to the TaskScheduler that oversubscription may be warranted.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsNoneDefault = "Continue on any, no task options, run asynchronously" Specifies that the default behavior should be used. Continuations, by default, will be scheduled when the antecedent task completes, regardless of the task's final TaskStatus.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsNotOnCanceledSpecifies that the continuation task should not be scheduled if its antecedent was canceled. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsNotOnFaultedSpecifies that the continuation task should not be scheduled if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsNotOnRanToCompletionSpecifies that the continuation task should not be scheduled if its antecedent ran to completion. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsOnlyOnCanceledSpecifies that the continuation task should be scheduled only if its antecedent was canceled. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsOnlyOnFaultedSpecifies that the continuation task should be scheduled only if its antecedent threw an unhandled exception. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsOnlyOnRanToCompletionSpecifies that the continuation task should be scheduled only if its antecedent ran to completion. This option is not valid for multi-task continuations.
Supported by Portable Class LibrarySupported in .NET for Windows Store appsPreferFairnessA hint to a TaskScheduler to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner will be more likely to be run sooner, and tasks scheduled later will be more likely to be run later.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft