locked
CurrentApp.LoadListingInformationAsync() throws ArgumentException RRS feed

  • Question

  • Hello,

    I've submitted an update to an app called 'Notes Sphere' which is set to free download but has the option for users to pay using in-app purchasing. During development I used the CurrentAppSimulator and then switched to the CurrentApp class for the release.

    In my code when I call "await CurrentApp.LoadListingInformationAsync()" an ArgumentException is throw with the message of "Value does not fall within the expected range." and an HResult of '-2147024809'.

    The internet connection is definitely working and I can see no reason why this call to the app store is failing. While it doesn't crash the app because the exception is caught, it does mean that users are currently unable to purchase the app.

    Before the call to CurrentApp.LoadListingInformationAsync() is made, calls to CurrentApp.LicenseInformation and CurrentApp.LicenseInformation.ProductLicenses[] are made and work absolutely fine.

    I've spend quite a while trying to find out why this is failing but so far haven't been successful. Currently the only thing I can think of that may cause the issue is that the app doesn't declare the "Internet (Client)" capability. However the other calls to the Windows Store seem to work fine.

    Thanks for any help,

    Grant


    • Edited by GrantSt Tuesday, December 11, 2012 1:19 PM
    Tuesday, December 11, 2012 1:19 PM

Answers

  • I think I may have solved the issue, although will have confirmation when the new release has finished certification and is in the store.

    If I'm right then the issue is that CurrentApp.LoadListingInformationAsync() must be run from the UI thread. My code does some initialisation work on a different thread as there's no point it running on the UI thread. The call to LoadListingInformationAsync() was made from a non-UI thread, running it via a dispatch call seems to have fixed the issue.

    • Marked as answer by Aaron Xue Tuesday, January 8, 2013 4:15 AM
    Tuesday, December 18, 2012 12:24 PM

All replies

  • Despite continuing to try and fix this issue I've so far been unsuccessful. I've attached the Visual Studio debugger to the version of the app I've installed from the store to see what was happening but that's not revealed anything more than I've mentioned in my previous post.

    I've also built and run a local development version using the CurrentApp, which does pickup the ProductLicences from the store for the app successfully, but yet again fails when LoadListingInformationAsync() is called. I tested enabling the "Internet (Client)" capability for the development version but that made no difference to the call.

    Is there a way of getting the formatted price for an in-app purchase product without using the LoadListingInformationAsync() call?

    At least that way I could get around using this method.

    I really need a solution for this problem, it's ridiculous having an app in the store which has broken functionality, especially when that functionality will actually produce income.

    If someone can provide an answer, or if someone from Microsoft could at least acknowledge the issue and provide some suggestions that would be fantastic,

    Thanks,

    Grant

    Thursday, December 13, 2012 4:00 PM
  • Hi,

    Did the CurrentAppSimulator.LoadListingInformationAsync(); run normally? Here is the same question, the advices in the following thread may help you.

    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/4e498ad0-e274-4f27-ac8a-f8a70943fff7/#8fe6d903-bfc9-4469-ae07-68da0cbbb61a 


    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, December 14, 2012 7:26 AM
  • And here is a resolved thread that got the same problem:

    http://social.msdn.microsoft.com/Forums/en-US/windowsstore/thread/a8e3372e-0378-4132-9be2-34df03ef1669/#c2cdb0b6-ab56-4316-a7f6-883b2f5979eb


    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, December 14, 2012 7:30 AM
  • Hi, thanks for replying!

    When I've run CurrentAppSimulator.LoadListingInformationAsync(); everything worked perfectly, so I was a bit surprised that after changing to CurrentApp, and installing it from the store it no-longer worked.

    My code catches any exceptions which may be thrown if internet access etc. isn't available. However this exception is thrown when internet access definitely is available.

    In regards to one of the posts you've mentioned, I did a quick test to see what happens if I just make the "CurrentAppSimulator.LoadListingInformationAsync()" call from a button click event instead of from a popup, which is shown from the bottom app bar. The call seemed to work under the debugger! So I'm going to make sure that a new page is shown for the purchasing part of the app instead if it occurring via a popup, once that's done I'll see what happens when I submit the next version to the store.

    Thanks,

    Grant

    Monday, December 17, 2012 3:47 PM
  • I think I may have solved the issue, although will have confirmation when the new release has finished certification and is in the store.

    If I'm right then the issue is that CurrentApp.LoadListingInformationAsync() must be run from the UI thread. My code does some initialisation work on a different thread as there's no point it running on the UI thread. The call to LoadListingInformationAsync() was made from a non-UI thread, running it via a dispatch call seems to have fixed the issue.

    • Marked as answer by Aaron Xue Tuesday, January 8, 2013 4:15 AM
    Tuesday, December 18, 2012 12:24 PM