Using TrySilentDownloadAndInstallStorePackageUpdatesAsync got an error: The specified account does not exist

Using TrySilentDownloadAndInstallStorePackageUpdatesAsync got an error: The specified account does not exist

使用 TrySilentDownloadAndInstallStorePackageUpdatesAsync 更新 UWP APP 时出现错误:指定的帐户不存在

我尝试根据示例代码here升级,同时使用StoreQueueItem.StatusChanged获取进度信息,有时我会获取此状态信息(使用个人热点会更容易出现这种现象):

 {
     "ExtendedError":null,
     "PackageInstallExtendedState":14,
     "PackageInstallState":4,
     "UpdateStatus":{
         "PackageFamilyName":"AppName",
         "PackageDownloadSizeInBytes":2260223,
         "PackageBytesDownloaded":2260223,
         "PackageDownloadProgress":0.95,
         "TotalDownloadProgress":0.95,
         "PackageUpdateState":3
     }
 }

看起来是暂停了,但为什么暂停了?我是否需要再次调用 TrySilentDownloadAndInstallStorePackageUpdatesAsync 才能安装?

同时我在事件查看器中看到一些错误日志(应用程序和服务->Microsoft-?Windows->商店->操作):

  1. Source: Store-SDK, Event ID: 2004, Task Category: In-App Purchase, Detail: SendStoreRequestWithUris( nullptr,UriHelperV7::InternalStoreEndpointExtensionUrls, UriHelperV7::InternalStoreEndpointExtensionUrlsIds::GetUserCollectionForProducts, cv, jsonCollectionsParameters.Get(), nullptr, collectionsJsonString.GetAddressOf()) Error: The specified account does not exist. Function: Windows::Services::Store::Internal::StoreContextServer::GetProductsByKinds Source: \storecontextserver.cpp (4460)
  1. Source: Store-SDK, Event ID: 2004, Task Category: In-App Purchase, Detail: ChkHr(hrGoldenTicket) Error: The specified account does not exist. Function: Windows::Services::Store::Internal::StoreContextServer::SendStoreRequestWithUris Source: \storecontextserver.cpp (4065)
  1. Source: Install-Service, Event ID: 2008, Task Category: Service, Detail: [Error] ResumeWithFlagsQueueItemId = {9369AD17-2AA2-42A8-8F76-335AFAB88741} Error: The operation completed successfully. Function: InstallQueue2::ResumeWithFlags Source: onecoreuap\enduser\winstore\installservice\libqueue2\installqueue2.cpp (432)

我该如何解决这个问题?

问题已解决。根本原因是我用了试飞。正式版没有这个问题。该问题只出现在试飞版本