Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File not found exception in background downloader

I am trying to resume background downloads once the app become active but it always gives file not found exception at .GetCurrentDownloadsAsync()

        IReadOnlyList<DownloadOperation> downloads = null;
        try
        {
            downloads = await BackgroundDownloader.GetCurrentDownloadsAsync();
            if (downloads.Count <= 0)
                return;

            foreach (DownloadOperation op in downloads)
            {

                op.Resume();

            }
        }
        catch(Exception ex)
        {

            System.Diagnostics.Debug.WriteLine(ex.Message);
        }
like image 745
suvish valsan Avatar asked Dec 01 '13 10:12

suvish valsan


2 Answers

I remember reading about a similar bug a while ago. It was fixed by uninstalling the app and then re-running the app from visual studio.

like image 108
Jon Avatar answered Oct 02 '22 21:10

Jon


There is a way to fix this without re-installing the app and it may be possible to do this in-code. It does feel like a hack however, but I have not seen any official acknowledgement about this bug.

In your app's local storage folder (the one that contains the 'LocalState' folder) delete everything in AC/BackgroundTransferApi

like image 37
Andres Avatar answered Oct 02 '22 19:10

Andres