Every time when I call CreateDownload on a BackgroundDownloader in my C# code for a Windows Store application, I get the following exception: Exception from HRESULT: 0x80072EE4
. I have declared all necessary capabilities in my package file.
Example This code breaks when CreateDownload() is called:
public static async void DownloadFile(string url){
var uri = new Uri(url, UriKind.Absolute);
FileSavePicker openPicker = new FileSavePicker();
openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;
openPicker.FileTypeChoices.Add("Video file", new List<string>() { ".mp4" });
StorageFile file = await openPicker.PickSaveFileAsync();
if (file != null)
{
DownloadOperation downloader = new BackgroundDownloader().CreateDownload(uri, file); //BREAKS HERE
//... (rest of code)
}
}
Exception This is the exact exception I get:
System.Exception was unhandled by user code
HResult=-2147012892
Message=Exception from HRESULT: 0x80072EE4
Source=Windows.Networking
StackTrace:
at Windows.Networking.BackgroundTransfer.BackgroundDownloader.CreateDownload(Uri uri, IStorageFile resultFile)
at Example.BlankPage1.<DownloadFile>d__1.MoveNext()
InnerException:
When I try to run the Windows 8.1 Background Transfer sample, I get the same exception at the same method.
When Googling on 0x80072EE4
, it is suggested that moving Temporary Internet Files would solve the issue. In my case, it didn't work.