The "Async Targeting Pack for Visual Studio 2012" enables projects targeting .NET Framework 4.0 or Silverlight 5 to use the Async language feature in C# 5 and Visual Basic 11. This pack requires Visual Studio 2012 and will not work with Visual Studio 2010.
The pack contains the API support necessary to use the 'async' and 'await' keywords in C# 5.0 and Visual Basic 11, as well as a set of Task-based adapter APIs that allow using some of the existing asynchronous APIs with the new language keywords.
This targeting pack is not required for projects targeting .NET Framework 4.5 or .NET for Metro style apps. It is only required for projects targeting Silverlight 5 and .NET Framework 4.0. Earlier platform releases are not supported.
More info on Task-based asynchronous programming in .NET: http://msdn.microsoft.com/async.
In this document:
The Async Targeting Pack for Visual Studio 2012 consists of a set of managed code assemblies that contain support types required
by the C# and Visual Basic compilers integrated into Visual Studio 2012 and .NET 4.5 in order to support the '
await' keywords, as well as some Task-based adapters for existing APIs. The pack is distributed via the
NuGet package management system. One single NuGet package contains assemblies for all of the
platforms supported by the Async Targeting Pack and the NuGet package manager will automatically ensure that your project references
the correct assemblies.
If you are already familiar with NuGet:
The package ID of the Async Targeting Pack that you can use when searching for it is:
You can also visit the NuGet package information page for management console instructions.
If you are not yet very familiar with NuGet:
In order to familiarize yourself with the NuGet system, to learn how to enable it in your Visual Studio 2012 and how to install the Async Targeting Pack into your project, please read the following pages:
- NuGet overview.
- Installing NuGet into Visual Studio.
Most flavours of Visual Studio 2012 already have NuGet pre-installed. If you version does not already have NuGet, follow this page to install it.
- Managing NuGet packages.
Learn here how to add the Async Targeting Pack to your Visual Studio project, and how to remove or update it.
When searching for the Async Targeting Pack in the Manage NuGet Packages Dialog, use the following package ID: "
- More NuGet documentation topics.
For each supported platform, two related, but distinct groups of functionality are included:
- Support types required by the Visual Studio 2012 C# and Visual Basic compilers to use the '
async' and '
- Task-based adapter APIs that allow using some of the asynchronous APIs that exist in the targeted platform version with the new language keywords.
Both groups of functionality have some differences to the equivalent features in .NET 4.5, and .NET for Metro Style Apps. A non-exhaustive list of these differences includes:
|.NET 4.5 / .NET for Metro Style Apps behavior||Async Targeting Pack behavior|
|There are some new static convenience APIs on the
||The new static convenience APIs are located on the
|.NET 4.5 has new, customized, more performant implementations for many Task-based asynchronous APIs.||Many Task-based Async methods included in this Async Targeting Pack have the same signatures as new Task-based Async methods added in .NET 4.5. The functionality of these methods is generally intended to be equivalent, but it is not always identical. This is because the APIs in this Targeting Pack are usually thin Task-based adapters for functionality already available on the respective platform.|
|Changes made to the current
||Changes made to the current
|When awaiting a cancelled
||A new / different
|When directly using
|If an awaited
||Continuations are always posted to the captured
|Visual Studio 2012 Debugger supports step-out for
||Visual Studio 2012 Debugger does not support step-out for
|A number of pre-completed