Silverligh 5 SDK RC + Async CTP : make it work
Just installed the Silverligh 5 SDK RC. There is a problem using it inside a project that uses the Async CTP.
Both AsyncCtpLibrary_Silverlight.dll and mscorlib.dll contains the Task type (And some other Task related types) that is sitting in the exact same namespace.
Here is the error msg:
So to solve this ambiguity I changed the Alias on the AsyncCtpLibrary_Silverlight.dll to "AsyncCtp". And then changed the cs file accordingly:
开发者_如何学编程 extern alias AsyncCtp;
using AsyncCtp::System.Threading.Tasks;
using AsyncCtp::System.Threading;
This seems to solve the ambiguity problem, but now the "async" keyword is not recognized. These are the related errors:
Is there a way around it, or is it a dead end ?
The only way around it would be to recompile the AsyncCtpLibrary_Silverlight.dll and remove all the TPL types from there. But I wouldn't bother... Check out the announcement at the Async CTP forum:
We are working on an update of the Async CTP. This will:
Address installation issues, where the current Async CTP can no longer be installed onto a fully-patched VS2010 SP1;
Provide compatibility with Silverlight 5;
Provide compatibility with background agents in Windows Phone apps.
We are working on this now, and will post the release here as soon as it’s available.
Update: Async CTP v3 was released with Silverlight 5 support: http://blogs.msdn.com/b/pfxteam/archive/2011/11/01/10232099.aspx
精彩评论