I'm developing a WP7.1 app on VS2012.
I'd like to use Live SDK for uploading a file to Skydrive. However, when I'm implementing the event handler method which is given as a sample on msdn.com I got the error "Cannot await 'void' " here:
private async void btnSignin_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
{
if (e.Status == LiveConnectSessionStatus.Connected)
{
client = new LiveConnectClient(e.Session);
LiveOperationResult operationResult = await client.GetAsync("me");
I already installed this (http://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx?PageIndex=2) library, but it only resolved the problem with the "async" keyword.
LiveConnectClient
is probably using the Event-based Asynchronous Pattern, which is not directly convertible to anawait
able method. You can wrap EAP into aTask
by usingTaskCompletionSource
as described on MSDN here.