简体   繁体   English

后台下载程序中找不到文件异常

[英]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() 我试图在应用程序变为活动状态时恢复后台下载,但它始终在.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);
        }

I remember reading about a similar bug a while ago. 我记得刚才读过类似的bug。 It was fixed by uninstalling the app and then re-running the app from visual studio. 通过卸载应用程序然后从visual studio重新运行应用程序来解决此问题。

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 在应用程序的本地存储文件夹(包含'LocalState'文件夹的文件夹)中删除AC / BackgroundTransferApi中的所有内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM