4

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?

Thiago Romam
  • 439
  • 4
  • 14

1 Answers1

6

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

valdetero
  • 4,624
  • 1
  • 31
  • 46
  • I tried before, but it shows an error of incompatibility: Could not install package 'Microsoft.Bcl.Build 1.0.13'. You are trying to install this package into a project that targets 'portable-win+net45+sl50+wp80+MonoAndroid10+MonoTouch10' – Thiago Romam Jan 24 '14 at 17:40
  • 2
    @ThiagoRomam Install the latest version of NuGet (2.7.2 or higher), and you should be able to install the Microsoft.Bcl.Async NuGet package in your portable library. – Daniel Plaisted Jan 24 '14 at 18:31