locked
Why can't ListingInformation be watched? RRS feed

  • Question

  • I have the following code:

    LicenseInformation LicenseInfo = CurrentApp.LicenseInformation;
    ListingInformation ListingInfo = await CurrentApp.LoadListingInformationAsync();
    //some statment, break point
     

    I can add LicenseInfo to Watch window to examine its contents without any problem, but adding ListingInfo generates the following error:

      The name 'ListingInfo' does not exist in the current context

    Could anyone shed some light on this?


    Hong

    Friday, December 20, 2013 1:09 PM

Answers

  • I have just realized this probably has nothing to do with ListingInformation. This has to do with the fact ListingInfo is not used after the statement to obtain an instance.  If it is used somewhere else, it can be watched normally like other variables.  

    Hong

    Monday, December 23, 2013 10:17 PM

All replies

  • Hi Hong,

    While testing I would like suggest you use CurrentAppSimulator instead of CurrentApp.

    The CurrentApp object obtains its data from the Windows Store, so you must have a Windows Store developer account and  the app must be published in the Windows Store. If you don't have a Windows Store developer account, you can test the functions of this class by using the CurrentAppSimulator.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, December 23, 2013 8:29 AM
    Moderator
  • Hi James,

    Yes, I have a WS developer account and the app has been published in the WS. LicenseInfo shows all the information (e.g. IsActive, IsTrial, active licenses) correctly.  I love this (actually I did not expect one could obtain this during debugging).  However ListingInfo obtained in the same manner has the problem described.


    Hong

    Monday, December 23, 2013 12:27 PM
  • Here is a strange situation which, I am sure, some experts can explain.

    The following is the code for testing this. Please read the comments that explain when an instance of ListingInformation can be watched.

    private async void Button_Click(object sender, RoutedEventArgs e) { Windows.ApplicationModel.Store.ListingInformation ListingInfo = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync(); //ListingInfo cannot be watched here

    await MyLibrary.FunctionFoo(); ListingInfo = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync(); //ListingInfo cannot be watched here } //The following is in MyLibrary public static async System.Threading.Tasks.Task FunctionFoo() { ListingInfo = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync(); //ListingInfo CAN be watched here }



    Hong

    Monday, December 23, 2013 1:38 PM
  • I have just realized this probably has nothing to do with ListingInformation. This has to do with the fact ListingInfo is not used after the statement to obtain an instance.  If it is used somewhere else, it can be watched normally like other variables.  

    Hong

    Monday, December 23, 2013 10:17 PM