GetAssociatedStoreProductsAsync always returns error in a Game!

MG Bhadurudeen 626 Reputation points
2021-05-18T02:36:28.167+00:00

Hi, I have several APPS in the store and get the addons info using the GetAssociatedStoreProductsAsync() method.
It returns the addons that are available for purchase from my app.

Recently I created a GAME. and when I use the same method to retrieve the addons it always returns an ExtendedError!

I use the method below:

        public async void GetAddOnInfo()  
        {  
            if (context == null)  
            {  
                context = StoreContext.GetDefault();  
            }  
  
            // Specify the kinds of add-ons to retrieve.  
            string[] productKinds = { "Durable", "Consumable", "UnmanagedConsumable" };  
            List<String> filterList = new List<string>(productKinds);  
  
            StoreProductQueryResult queryResult = await context.GetAssociatedStoreProductsAsync(filterList);  
  
            if (queryResult.ExtendedError != null)  
            {  
                // The user may be offline or there might be some other server failure.  
                Debug.WriteLine($"ExtendedError: {queryResult.ExtendedError.Message}");  
                return;  
            }  
  
            foreach (KeyValuePair<string, StoreProduct> item in queryResult.Products)  
            {  
                // Access the Store product info for the add-on.  
                StoreProduct product = item.Value;  
  
                // Use members of the product object to access listing info for the add-on...  
            }  
        }  

I get this error:
ExtendedError: Exception from HRESULT: 0x803F6107

What's wrong with my code? I have similar apps, with the same code. They return the addons. I am selling addons for the past 3 years.
As a try, I associated my game with the store again, still the same error. I recreated the certificate by using a Test Certificate. No use.

My project's Min: 16299, Target: 18362, Local Machine: W10 Pro, x64, 10.0.19042 Build 19042

I got this code from this document.
https://learn.microsoft.com/en-us/windows/uwp/monetize/get-product-info-for-apps-and-add-ons

Universal Windows Platform (UWP)
Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
833 questions
{count} vote

Accepted answer
  1. Roy Li - MSFT 31,261 Reputation points Microsoft Vendor
    2021-05-20T06:52:00.12+00:00

    Hello,

    Welcome to Microsoft Q&A!

    GetAssociatedStoreProductsAsync always returns error in a Game!

    Based on the error code 0x803F6107 message Something unexpected happens while processing a Store operation., it looks like the issue is related to the Store part. So I suggested @MG Bhadurudeen try to purchase the add-on product directly with the Store ID to check if the issue is just with the GetAssociatedStoreProductsAsync() or the status of the add-on itself.

    The method gives another error code- 0x803F6108 which means The license for the application is missing information needed to perform Store operations. If you side-loaded the application, uninstall the application and download it from the Store first to get the Store license associated with the application.

    This error message is more clear than the first one and we could know that the Store certification might be the root cause of this issue. The possible way to solve it is to renew the license of the app.

    At last, @MG Bhadurudeen uninstalled, then installed the app from the store. and uninstalled. then installed from Visual Studio. Now the app is working correctly.

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful