The AsyncCTP is getting a bit long in the tooth. This post is to explain how, why, and what to do.
- AsyncCTP fails to install -- i.e. it doesn't create the "Async CTP" folder inside "My Documents", and VS doesn't recognize the async keywords.
- Installing VS11 causes AsyncCTP to stop working.
- AsyncCTP doesn't work on Windows 8.
The AsyncCTP is an update. It updates Visual Studio 2010 with modified versions of the VS IDE compilers that colorize the new keywords. It also updates the .NET4 framework with modified versions of the command-line csc.exe and vbc.exe compilers. But the AsyncCTP was never incorporated into Microsoft's official source code for VS2010 or .NET4, and was never meant to be -- it's just an experimental CTP.
And so, when Microsoft produces official updates to either VS or .NET4, and they touch the same files, then they tend to overwrite the AsyncCTP -- or prevent it from installing in the first place.
Also .NET45, which comes with VS11 and Win8, is an in-place update on top of .NET4, and so replaces the csc.exe and vbc.exe from the AsyncCTP with updated ones. As Stephen Toub explains, the new csc.exe and vbc.exe are incompatible with AsyncCTPLibrary.dll.
What to do
- Best option is to upgrade to VS11 Beta and .NET45. It has much better async support (fewer bugs, more features, better debugging, better perf)
- Failing that, if you're stuck with VS2010 + AsyncCTP, here are ideas:
- If you already have VS2010 + AsyncCTP working, then don't install VS11.
- If you have VS2010 SP1 but the AsyncCTP installer doesn't seem to have worked, the problem might be conflicting updates such as
KB2635973, KB2615527, KB2645410
Any update after October 11 is liable to conflict, though. Go to ControlPanel > AddRemovePrograms > WindowsUpdates and uninstall them if present.
- Targeting .NET45 with async:
you have to use VS11 Beta, which works fine.
- Targeting Silverlight5 or .NET4 with async:
you're currently stuck with VS2010 + AsyncCTP. We're exploring options here to let you use VS11 instead.
- Targeting Windows Phone with async:
again you're currently stuck with VS2010 + AsyncCTP.
- If you can set up a VM with only VS2010 SP1 and no updates, then AsyncCTP should install fine.
Then you can copy the "Microsoft Visual Studio Async CTP" folder out of My Documents, to use on other machines.
- From the same VM, you could go C:\Windows\Microsoft.Net\Framework and copy the following files. They constitute the entirety of AsyncCTP updates to the .NET4 framework. You could copy these files to a build machine, for instance, and then msbuild would use the AsyncCTP without needing to run the installer. (Caution! This will likely break regular .NET updates!)
- csc.exe, vbc.exe, 1033\cscui.dll, 1033\vbc7ui.dll
- It's theoretically possible to do the same trick for VS2010, copying just the files that were modified by the AsyncCTP installer. But this is error-prone and more likely to leave VS2010 in a broken state than not.
NB. The AsyncCTP installer has a problem with network drives: if your My Documents is mapped to a network drive, then it won't install.
We understand async has become indispensable for many of your projects. Ultimately, though, we can't support the AsyncCTP -- it's too fragile and has too many bugs. It took us an entire release cycle to fix it, and VS11/.NET45 is the result. The only long-term supportable strategy is for people to migrate over to VS11. As soon as we've figured out the migrate story, we'll let you know.
PS. If you notice other updates which conflict with AsyncCTP, please post in the comments here, and I'll update the instructions.