locked
Silverlight 5 and C# 5 async / await syntax RRS feed

  • Question

  • Like many others I was wondering whether Silverlight 5 will allow C# async / await syntax when Silverlight 5 is released by the end of this year. To avoid disappointment when Silverlight 5 is released by the end of the year, please confirm my understanding. I think the answer will be NO unfortunately; in production code that is. It's so easy to confuse the version number of the framework with the version number of the language / compiler. So, while Silverlight 5 will be a new version of the Silverlight framework, I suspect we will not yet have a production release of the C# 5 compiler by the end of this year. So by the end of the year the Silverlight 5 framework will still have been written using the C# 4 language and compiled with the C# 4 compiler, and any Silverlight 5 applications we write in Visual Studio 2010 using the Silverlight 5 framework will still be written using the C# 4 language and compiled with the C# 4 compiler *. Unless you use the Async CTP, but that is not licenced for production use. So the remaining question is, when will we see a production release of the C# 5 compiler and with which version of Visual Studio will that be. Would be good if that could be a service pack 2 of Visual Studio 2010, but must likely wil be the next full version of Visual Studio. How many years away is that... ?

    * Just like I understand the Silverlight 4 framework itself was written using the C# 3 language / compiler, even though we are now capable of using the C# 4 language / compiler when we write Silverlight 4 applications in Visual Studio 2010. See http://social.msdn.microsoft.com/Forums/en-US/rx/thread/bcfd633a-0693-46ef-850b-7186f7372ce0/#ec14559e-ad22-421a-adf7-1c4e853ed334 on why the Silverlight 4 framework has not implemented co - and contravariance: because it was written and compiled using C# 3, not C# 4. Unfortunately in that thread reference was made to the C# 3.5 compiler, but I think the C# 3 compiler was meant. 3.5 is a version of the .Net framework, not the C# language / compiler. If I remember correctly, Visual Studio 2005 has the C# 2 compiler and is capable of targeting .Net framework 2.0 and .Net 3.0. Visual Studio 2008 has the C# 3 compiler and is capable of targeting .Net framework 2.0, 3.0 and 3.5 (allowing you to write C# 3 while still targeting .Net framework 2.0 or 3.0) and Silverlight 3. And Visual Studio 2010 has the C# 4 compiler and is capable of targeting .Net framework 2.0, 3.0, 3.5 and 4.0 (again, allowing you to write C# 4 while still targeting .Net framework 2.0, 3.0 or 3.5) and Silverlight 3 and 4.

    Thursday, February 10, 2011 2:48 PM

Answers

  • Hi Remco-

    The Async CTP does now have a license that allows for production use, if you choose to use it as such.  We also plan to augment Silverlight with the async language support, but we don't have any timeframe or version to announce around that.  We're currently hard at work on the next version of the .NET Framework and Visual Studio, which are scheduled to include the async functionality.

    Thanks,

    Stephen

    Tuesday, July 5, 2011 5:11 PM
    Moderator

All replies

  • Hi Remco-

    The Async CTP does now have a license that allows for production use, if you choose to use it as such.  We also plan to augment Silverlight with the async language support, but we don't have any timeframe or version to announce around that.  We're currently hard at work on the next version of the .NET Framework and Visual Studio, which are scheduled to include the async functionality.

    Thanks,

    Stephen

    Tuesday, July 5, 2011 5:11 PM
    Moderator
  • I hope you have good news about Silverlight 5 and Async, do you know is it going?
    Thursday, October 6, 2011 8:17 PM