Async Targeting Pack

[UPDATE: The async targeting pack has been renamed "Microsoft.Bcl.Async". It now supports async for portable libraries]


We’ve just released an "Async Targeting Pack” [update: replaced by Microsoft.Bcl.Async] via NuGet. It lets you use the async feature of VS11 for applications that target Silverlight5 or .NET4. (You don't need it if you're using VS11 to target .NET45).

We expect all users of VS2010+AsyncCTP to upgrade to VS11. That’s because VS11 implements the async feature fully, and is supported. By contrast the AsyncCTP has many known bugs in its implementation of async, is not supported, and is difficult to install.

We intend not to release any further versions of the AsyncCTP. For the sake of Azure and Windows Phone, however, we are keeping the AsyncCTP for VS2010 online for now [link]. It remains unsupported. Update: the new Microsoft.Bcl.Async works fine for Windows Phone.


I want to put in a note of appreciation to David Grunwald, Omer Mor and Alex Davies who released AsyncBridge while we were putting together the Async Targeting Pack. Great work!




Some reminiscences of the Async CTP

Now that the Async CTP can (almost) finally be laid to rest, here's a logo from it:

Mads Torgersen has two whiteboards in his office that hang from a picture-rail. Right at the very beginning of our first discussions on async, he wrote the word "await" in giant filled-in lettering on the boards and pushed the two halves apart to opposite ends of the wall. I used that to create the logo.


My favorite real-life Async anecdote comes from covert observations of Anders Heijlsberg in the Microsoft cafeteria checkout line. He ordereds burritos more days than not... (1) He walks to the burrito counter, makes an order, and gets a receipt. (2) He queues up at the cash register to pay for the receipt. (3) Then he goes back to the burrito folks who have by now finished preparing his meal. If that's not async in action, I don't know what is!

Dim receipt As Task(Of Burrito) = OrderBurritoAsync()
Await receipt


On another occasion, Mads was giving a talk about async to some group within Microsoft. He'd missed breakfast and was eating a banana at the podium, waving it about animatedly as he discussed async control flow. We called it his "async banana". It's an old Microsoft tradition to share chocolates, cakes and cookies with colleagues, so that evening I baked some "Async banana bread" and brought it into the office the next day. First workitem was a bug report from our QA team that Finally bodies were sometimes being executed twice inside async methods. So that evening I baked a second identical "Async banana bread" and brought it into the office as a dupe. (The bugfix on this occasion was so subtle that it left even Jon Skeet scratching his head for weeks!)


We just got word that the AsyncCTP has been downloaded over 50,000 times. That's a huge number of downloads for an experimental preview of a language feature. We're hugely glad to have had people use it, and give their feedback, and shape the final product. But it was just an experimental technology preview, and we're glad to finally have VS11 and the Async Targeting Pack as its replacement.


Comments (14)
  1. fatcathu says:

    Silverlight4 ? you meant 5

  2. @WalkingCat: thanks, I did mean SL5!

  3. Omer Mor says:

    Thanks Lucian!

    AsyncBridge was a fun little project. It is still useful for async in .NET 3.5, but I'm glad to see an official offering for .NET 4 & SL5.

    Keep up the good work!

  4. Jens says:

    Great logo …

  5. Hi Lucian

    I have one concern with the new targeting pack and developing in VS 11 while targeting .NET 4.

    In our office we created an small spike WCF solution (Server/Client) that uses a ServiceContract let's say ISomeService that has one operation contract that returns a Task<T>. For creating this we used VS 11 with the new targeting pack and of course we were targeting .NET 4 for both projects Server and Client.

    Now the problem is that even though we know WCF 4 cannot serialize Tasks our solution compiled and ran perfectly in our development PC but when testing it in an XP PC with just .NET 4 installed for obvious reasons (.NET 4.5 doesn't support XP) our bits failed with the exception that Tasks cannot be serialized etc etc. perfectly understandable since .NET 4 cannot serialize Tasks.

    Now we can avoid this and not use Task<T> returning services in WCF since we are targeting .NET 4 because we now about this problem and NOT because when we were developing and testing VS 11 even targeting .NET 4 failed, which is the behavior I will expect from VS 11 to fail when I try to run a project that targets .NET 4 the way is not supposed to be used.

    So my real concern is what kind of other problems we can be incurring in using async/await features while developing in VS 11 + Async Targeting pack even though you target .NET 4 rather than using VS 2010 + Async CTP. I mean we will be incurring into those problems since we will be developing in VS 11 thinking that we are safe because we targeted .NET 4 framework when in reality when we test our apps in an environment with just .NET 4 they can fail.

    Even worse my wild guess is that all these problems are related to the fact that .NET 4.5 is an in-place update to .NET 4 so what ever .NET 4.5 fixed, improved, added or replaced from .NET 4 will be the real stuff we will be using in our development environments with VS 11 and .NET 4.5 no matters we explicitly target .NET 4 leading to a possible failure when our apps run in a just .NET 4 environment.

    So my point here is what is the advantage to use VS 11 + Async targeting pack for targeting .NET 4 over VS 2010 + Async CTP if at the end chosing the first can shoot ourselves in the foot.

    I would really appreciate if someone knows a way to overcome this problem (I mean being able to properly use VS 11 + Async targeting pack while targeting .NET 4 knowing that our apps will safely run in for example XP), probably we did something wrong with our spike WCF solution. Any feedback will be greatly appreciated.

    by the way does anyone know if at the end .NET 4.5 will support XP this will make our lives easier 😉 or if at least the final .NET 4.5 will be a side by side installation rather than in-place update (I guess this could solve my problem as well eventhough I much prefer .NET 4.5 supporting XP so we can all make use of the new features at full capacity)



  6. Ladislav says:


    can we also expect the async version of add service reference?



  7. @AG1ez – we don't think that's the right explanation for what you saw. Task wasn't and isn't serializable. If you can make a minimal repro of a project which behaves differently on a machine with .NET4 vs one with .NET45, please email me – lwischik at microsoft com.

  8. Jon Pawley says:

    Kia ora, Lu. Good reading some of your news that popped up in my RSS feed 😉

  9. Hi Lucian

    Any news regarding the sample project I sent you?



  10. DGlick says:

    Another item you may want to add to the readme: SynchronizationContext.Copy gets called on 4.0, unlike on 4.5. I knew that, but I'd forgotten it and it took me a couple of hours debugging to figure it out. 🙁

  11. @AG1ez, sorry I didn't have time last week (went to New York for the weekend!). Hopefully later this week.

  12. Gabriel says:


    I'm experimenting with the pack. async/await is pure joy!

    I've encountered a problem which appears to be a bug because I can't repro in .Net 4.5.

    Awaiting on a dynamic will throw that the TaskAwaiter'1 cannot be cast to System.Runtime.CompilerServices.INotifyCompletion. Very simple to repro:

    dynamic dyn = SomeAsync();

    await dyn;

    Building and running the code in 4.5 works flawlessly.

    The reason for doing this in our code is that we have some CallHandler in the interception pipeline (we're using Unity) that needs to do something after the task is finished.

    Any chance this will get fixed? Is there a workaround? Is there a forum or a better place where I can post this?


  13. Hi Lucian,

    at first, thank you quite much 🙂 Found the blog cos of your AsyncCTP install description. Helped quite a lot, finally a version thad the system admins understand as well as the developer 😉

    In my team were using the AsyncCTP for quite a while now. A view of us updated to VS2012 while I have to stay on VS2010 for the time beeing. We use .Net 4 and AsyncCTP with an AsyncCtpLibrary assambly for the projekt references. The others using VS2012 want to use the NugetPackage ure providing here in there projekts targeting FW 4.0.

    My Question, are there compatible? As in, can I with VS11 + AsyncCTP use the FW 4.0 projekts with the NuGet AsncyAssambly while they do the same using VS12? Or is your package not compatible with VS11 + AsyncCTP?

    Current Async Assembly:

    ( AssemblyVersion("1.0.4107.18181"), Guid("251C8E1C-2355-4FEC-99F3-4728EE01E237") )



  14. Async targeting pack was great move by Microsoft. I made a lot of asynchronous calls in Silverlight project and it was really painful to handle all those callbacks. When I used async CTP I realized that it only supported methods with the form of Begin… and End… naming convention. However most of the service proxies use the …Async and …Completed convention. So I wrote a simple wrapper library for async CTP ( to make async calls event easier. (You know programmers are always looking for ways to do it even easier!). I am wondering if my wrapper library is still useful?

Comments are closed.

Skip to main content