Windows runtime 获取应用内产品购买时应用挂起

Windows runtime 获取应用内产品购买时应用挂起,windows-runtime,windows-store-apps,win-universal-app,windows-10,uwp,Windows Runtime,Windows Store Apps,Win Universal App,Windows 10,Uwp,我正在开发一个UWP应用程序,它有一个单一的应用程序内购买 我已经在我的Microsoft开发者帐户中创建了应用内购买,并将其提交审查,该审查已在Windows应用商店中发布 我在我的应用程序中创建了如下逻辑: private async Task CheckInAppPremium() { #if DEBUG var file = await Windows.ApplicationModel.Package.Current

我正在开发一个UWP应用程序,它有一个单一的应用程序内购买

我已经在我的Microsoft开发者帐户中创建了应用内购买,并将其提交审查,该审查已在Windows应用商店中发布

我在我的应用程序中创建了如下逻辑:

    private async Task CheckInAppPremium()
    {
        #if DEBUG
        var file =
            await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"Data\in-app.xml");
        await CurrentAppSimulator.ReloadSimulatorAsync(file);
        var licenseInformation = CurrentAppSimulator.LicenseInformation;
        #else
        var licenseInformation = CurrentApp.LicenseInformation;
        #endif
        if (!licenseInformation.ProductLicenses["Premium"].IsActive)
        {
            #if DEBUG
            var results = await CurrentAppSimulator.RequestProductPurchaseAsync("Premium");
            #else
            var results = await CurrentApp.RequestProductPurchaseAsync("Premium");
            #endif
            Success = results.Status == ProductPurchaseStatus.Succeeded;
            if (Success)
            {
                _localSettings.Values["premium"] = true;
                Messenger.Default.Send(new PremiumInAppAcquiredMessage());
            }
        }
    }
当应用程序在调试模式下运行时,一切正常,但当应用程序在发行版中编译时,应用程序挂起在以下行:

var licenseInformation=CurrentApp.licenseInformation


我不知道我错过了什么,尽管我遵循了Microsoft的建议。

您是否将应用程序与您的Microsoft store帐户关联,并在您的store帐户中添加了ProductPurchaseId,即premium?其停在
var licenseInformation=CurrentApp.licenseInformation因为它正在尝试从您的商店帐户检索值。是,我的应用与我创建Premium in-app产品的同一帐户关联。我的应用程序已经发布到商店,并再次提交,但无法解决问题。你的应用程序是否正常工作或是否正在崩溃。挂起归因于同步检索许可证信息。该应用程序运行良好。对LicenseInformation的调用挂起10秒,然后引发异常(我现在不记得类型)