gpt4 book ai didi

uwp - 我无法获得正确的 StoreContext

转载 作者:行者123 更新时间:2023-12-05 02:03:34 26 4
gpt4 key购买 nike

我已将我的应用程序提交到 Windows 应用商店并通过了认证。根据测试说明:

https://learn.microsoft.com/en-us/windows/uwp/monetize/in-app-purchases-and-trials#in-app-purchases-and-trials-using-the-windowsservicesstore-namespace

我已将该应用发布为隐藏应用。我还将应用关联到应用商店:

enter image description here

当我调试我的应用程序时,我从未获得正确的 StoreContext 实例。我有以下错误:

enter image description here

根据上面的文档链接,这是我遇到的问题:

If you do not associate your project with an app in the Store, the StoreContext methods set the ExtendedError property of their return values to the error code value 0x803F6107. This value indicates that the Store doesn't have any knowledge about the app.

我如何让我的应用程序(或 Visual Studio)了解我的商店状态?

最佳答案

我刚刚弄明白了。这些步骤必须完全按照以下顺序完成:

  1. If your app is not yet published and available in the Store, make sure your app meets the minimum Windows App Certification Kit requirements, submit your app in Partner Center, and make sure your app passes the certification process. You can configure your app so it is not discoverable in the Store while you test it. Please note the proper configuration of package flights. Incorrectly configured package flights may be not be able to be downloaded.

  2. Next, make sure you have completed the following:Write code in your app that uses the StoreContext class and otherrelated types in the Windows.Services.Store namespace to implementin-app purchases or trial functionality. If your app offers an add-onthat customers can purchase, create an add-on submission for your appin Partner Center. If you want to exclude or limit some features in atrial version of your app, configure your app as a free trial inPartner Center.

  3. With your project open in Visual Studio, click the Project menu, point to Store, and then click Associate App with the Store. Complete the instructions in the wizard to associate the app project with the app in your Partner Center account that you want to use for testing.

  4. If you have not done so already, install the app from the Store that you specified in the previous step, run the app once, and then close this app. This ensures that a valid license for the app is installed to your development device.

  5. In Visual Studio, start running or debugging your project. Your codeshould retrieve app and add-on data from the Store app that youassociated with your local project. If you are prompted to reinstallthe app, follow the instructions and then run or debug your project.

我所做的是将第 3 步和第 4 步颠倒过来 👍 并且成功了!

关于uwp - 我无法获得正确的 StoreContext,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65023413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com