Question

I downloaded Async CTP and installed it on my development machine, which has both VS 2010 and VS 2012. The installation seemed to have completed successfully (no errors).

I created a brand new WinForms project (language: VB.NET), and decorated a Form_Load with Async.

Problem is that Async keyword is not recognized. Did anyone manage to make it work and how?

Doing the same in VS 2012, targeting .NET framework 4.5 works.

Note: I don't need any Silverlight, Windows Phone or even Web at this time.

Was it helpful?

Solution

As suggested by @Ramhound, I uninstalled everything related to VS 2012 and 2010, then installed 2010 + SP1 + applied Async CTP3. Properly installed Async CTP3 shows a welcome screen and prompts to restart. After that VS 2010 starts supporting the async keyword. However, for the full support, it is required to reference a corresponding library from here (platform dependent):

c:\Users\%username%\Documents\Microsoft Visual Studio Async CTP\Samples\

In my case it was AsyncCtpLibrary.dll. Otherwise it will highlight the syntax, but won't compile.

OTHER TIPS

There should be no need to do this.

You already had VS2012 installed, which has full support for async/await. You can install Microsoft.Bcl.Async to get async/await support on downlevel platforms, including .NET 4.0.

I answered it in Asynchronous Programming with Async and Await and if to use more C# 5.0 features without installing .NET 4.5. /VS2012 (which is impossible in Winfows XP) than just async/await in my answer to Where can I find a TPL dataflow version for 4.0?.

Note that .NET 4.0 on machine with installed .NET 4.5 is different from .NET 4.0 with installed .NET 4.5 In other words you cannot reliably develop and test .NET 4.0 applications on machine with installed .NET 4.5. The latter is independent on wherher you installed extensions or not

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top