Search code examples
c#asynchronousxamarin.iosxamarin.androidportable-class-library

Async/await in PCL Profile 158 targeting Android and IOS too


I have a PCL Profile 158 with Android and IOS. I also want to use async/await. I find some solutions for this problem, but I can't got it working.

When I try to use await, visual/xamarin studio shows an error saying: Type 'System.Threading.Tasks.Task<...>' is not awaitable.

Is there any way to get it working or an alternative to use async/await operations?


Solution

  • Did you also install the nuget package for Microsoft.Bcl.Async? I think you need that to get async/await in a PCL.