I'm having trouble downloading files through the Windows storage application. Here is my download method:
private static async void DownloadImage() { HttpClient client = new HttpClient(); HttpResponseMessage message = await client.GetAsync("http://coolvibe.com/wp-content/uploads/2010/05/scifiwallpaper1.jpg"); StorageFolder myfolder = Windows.Storage.ApplicationData.Current.LocalFolder; StorageFile sampleFile = myfolder.CreateFileAsync("image.jpg", CreationCollisionOption.ReplaceExisting).GetResults();
In the marked line, I get this exception:
An exception of type 'System.InvalidOperationException' occurred in ListStalkerWin8.exe but was not handled in user code WinRT information: A method was called at an unexpected time. Additional information: A method was called at an unexpected time.
What could be the reason for this?
source share