LiveConnectClient | DownloadAsync crashes without an exception

308 views Asked by At

WP8, VS 2013 Live SDK (nuget) v5.5

private async void DownLoadImageFromSkyDrive(string imgUrl, Int32 number)
{
    LiveConnectClient client = new LiveConnectClient(_currentSession);
    var image = await client.DownloadAsync(imgUrl + "/content");
    BitmapImage bitmap = new BitmapImage();
    bitmap.SetSource(image.Stream);
}

After the execution of

var image = await client.DownloadAsync(imgUrl + "/content");

The callstack is in the parent function. There's no exception, but

BitmapImage bitmap = new BitmapImage();

is not executed. The code has worked....

1

There are 1 answers

1
Andras Csehi On BEST ANSWER

Or not yet executed... You function is an async method with no return value. It doesn't block the caller. Also I believe async void won't pass the exception to the caller. Put the try catch block in DownLoadImageFromSkyDrive to see what's going on.