Task::Start Method ()
Assembly: mscorlib (in mscorlib.dll)
A task may be started and run only once. Any attempts to schedule a task a second time will result in an exception.
The Task constructors. Typically, you do this when you need to separate the task's creation from its execution, such as when you conditionally execute tasks that you've created. For the more common case in which you don't need to separate task instantiation from execution, we recommend that you call an overload of the Task::Run or TaskFactory::StartNew method.is used to execute a task that has been created by calling one of the
For information on handling exceptions thrown by task operations, see Exception Handling (Task Parallel Library).
The following example calls the Task(Action^) constructor to instantiate a new Task object that displays its task ID and managed thread ID and then executes a loop. It then calls the method to execute the task. Since this is a console app, the call to the Wait method is necessary to prevent the app from terminating before the task finishes execution.
Available since 8
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Available since 8.1