4

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.

Wietze
  • 41
  • 3
  • Anuthing in that InnerException? – H H Jan 26 '14 at 14:39
  • @HenkHolterman: No, it is empty. – Wietze Jan 26 '14 at 14:54
  • It is a Windows error code, 12004 = ERROR_INTERNET_INTERNAL_ERROR, "An internal error has occurred". Well, that ought to narrow it down :( That WinRT was designed by the Microsoft Windows group instead of DevDiv is painfully obvious in the error reporting. – Hans Passant Jan 26 '14 at 16:09
  • Are you trying this in the simulator or an actual desktop? – Nate Diamond Jan 27 '14 at 01:21
  • @NateDiamond, my actual desktop. Simulator gives the same result, seems to use my desktop environment. – Wietze Jan 27 '14 at 11:38
  • @Wietze Did you ever figure out the cause of this exception? I am starting to see it in error reports, but the HRESULT code is not really helping. – Igor Ralic Feb 23 '15 at 11:05
  • Eventually, the problem did no longer show up. Possibly as the result of an update of .NET Framework or Visual Studio. – Wietze May 03 '15 at 09:50

2 Answers2

1

I know this is an old question, but still, I guess I just found some input for what it's worth.

I was getting the HRESULT: 0x80072EE4 error after removing all permissions for the windows user/account that (I guess) my app is using for writing temp files when using background-downloader (and probably other stuff).

Check the permissions on the "{userAccount}\AppData\Local\Packages{yourAppName}\AC" folder, and specifically the "BackgroundTransferApi" folder in there, and make sure that there is an account named something like "S-1-15-2-.......{veryLongString}" and that it has all the permissions set.

Hope this helps some future visitor :)

trailynx
  • 41
  • 2
0

For me, I received this error with the SSL certificate was invalid on the site I was trying to access.

Specifically: NET::ERR_CERT_AUTHORITY_INVALID

When I resolved the SSL certificate - the background downloader no longer had that error.

Dave Friedel
  • 1,028
  • 1
  • 14
  • 20