HRESULT 0x80072EE4 when using BackgroundDownloader

Every time I call CreateDownload in BackgroundDownloader in my C # code for a Windows Store application, I get the following exception: Exception from HRESULT: 0x80072EE4 . I declared all the necessary features in my package file.

Example This code is interrupted 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 that 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 migration sample , I get the same exception in the same method.

When Googling on 0x80072EE4 , it is recommended that moving temporary Internet files solve the problem. In my case, this did not work.

+3
source share
2 answers

I know this is an old question, but still, I think I just found some input for what it costs.

I got the HRESULT error: 0x80072EE4 after removing all permissions for the Windows user / account, which (I think) that my application uses to write temporary files when using the background-downloader (and possibly other things).

Check the permissions of the folder "{userAccount} \ AppData \ Local \ Packages {yourAppName} \ AC" and, in particular, the folder "BackgroundTransferApi") and make sure that there is an account with the name "S- 1-15-2 -. ...... {veryLongString} "and that it has all permissions.

Hope this helps future visitor :)

+1
source

For me, I got this error with an SSL certificate on a website that I was trying to access.

Specifically: NET :: ERR_CERT_AUTHORITY_INVALID

When I enabled the SSL certificate, the background loader no longer had this error.

0
source

Source: https://habr.com/ru/post/1270752/


All Articles