GetAwaiter Error in PCL

Hi,
In my PCL utilizing Microsoft WindowsAzure MobileServices Sync I am getting an error in relation to the MessageDialog ShowAsync() line of code:

public async Task SyncAsync()// offline sync
{
string errorString = null;
try
{
await App.MobileService.SyncContext.PushAsync();
await FacilitiesTable.PullAsync("facility", FacilitiesTable.CreateQuery());
}
catch (MobileServicePushFailedException ex)
{
errorString = "FacilitiesViewModel: Push failed because of sync errors: " +
ex.PushResult.Errors.Count + " errors, message: " + ex.Message;
}
catch (Exception ex)
{
errorString = "Unable to Sync " +
"\n\nIf you are still in an offline scenario, " +
"you can try your Sync again when connected with your Mobile Service.";
}

        if (errorString != null)
        {
            MessageDialog d = new MessageDialog(errorString);
            await d.ShowAsync();
        }
    }

/**************************************************************

The error is:
'IAsyncOperation' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation' could be found (are you missing a using directive for 'System'?)

/**************************************************************

Any help would be appreciated.
Karl.

Sign In or Register to comment.