Due to work restrictions, I need to continue using Visual Studio 2010 for the immediate future. At the same time, I have been learning about Async in my personal coding. Is the latest Async CTP fully consistent with the Async language features of C# 5.0? And is installing the Async CTP the correct way to use Async with VS2010?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
The Async CTPs are not fully consistent with the final C# 5.0 implementation, though the keywords are the same.
If your real business need is to produce an app that can run on .NET 4.0, then the recommended approach is to use VS2012 with the async targeting pack (available via NuGet).
Under this configuration, your development machine has .NET 4.5 and VS2012, however the binary produced from your solution build will be compatible with .NET 4.0.
This results in the fullest support for the async language feature, since the VS2012 + async targeting pack gives you the exact same official compiler, and is higher than CTP quality.
Given the way that .NET 4.5 installs on top of .NET 4, and the challenges that that could present, I would try to separate your work environment from your personal development environment as far as possible.
You could install VS2010 and VS2012 on the same machine, and I'd recommend that over using the async CTP:
However, I think it would be safer to develop on a VM or a separate machine instead, if at all possible.
The least attractive option would be to use the CTP, IMO - I can see only risks on that front, to be honest.
The Async CTP is the only way to use
async
in Visual Studio 2010. However, it is not theasync
that made it into .NET 4.5 / Visual Studio 2012, several bugs in the CTP have been fixed in the final release. You will not get these bug fixes in Visual Studio 2010, according to the CTP's readme:If you absolutely need VS 2010, what I would try is to install the Async CTP first, and then install .NET 4.5 (both runtime and SDK). Develop in Visual Studio, but build using the standalone compiler.