Can the Async CTP be used with a portable library
Asked Answered
S

4

6

I was looking to see if the Async CTP with a portable class library?

Sylvanus answered 5/2, 2012 at 20:16 Comment(0)
A
5

No. The Async CTP has different dlls for Desktop, Phone, Silverlight 4, and Silverlight 5.

Hopefully in the near future, all these platforms will support Task (and async) natively, and then portable class libraries would be able to use async.

Update: Microsoft.Bcl.Async can be installed for portable libraries targeting .NET 4.0/4.5, Windows Store apps, Silverlight 4/5, and Windows Phone 7.5/8.0

Alaric answered 7/2, 2012 at 1:21 Comment(1)
This is what I found with my testing. For the meantime I think it is easier to just maintain two different core libraries as there are a few other libs that have the same requirements.Sylvanus
D
2

In Visual Studio 2012 RTM async/await syntax can be used in Portable Class Libraries, at least when targeting .NET 4.5 and WinRT.
Edit: It's now possible to use async/await even in Portable Class Libraries targeting WP7.5/WP8 + Silverlight 4/5 + .NET 4.0/4.5 + WinRT using Microsoft.Bcl.Async library.

Disturbing answered 19/8, 2012 at 12:21 Comment(0)
H
2

As a heads up, we've started planning a release of Async that will support down-level (.NET 4.0, SL5, Phone 7.5) portable:

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2691068-support-async-in-portable-class-libraries

Hermon answered 13/9, 2012 at 2:8 Comment(0)
P
0

You can use beta version of Microsoft.Bcl.Async - I already use it in my projects and it behaves stable to be used in real projects.

Preciado answered 30/11, 2012 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.