none
Crash in review due to AccessDenied

    Question

  • My app is in review now at content compliance stage, I have not recieved "fail" result yet, but most probable I will. I am logging exception error results from the code to my web-service and here what I am getting: 

    Access is denied.
          at Windows.ApplicationModel.Store.CurrentAppSimulator.get_LicenseInformation()
       at LG.Models.GameFrame.<Module_OnNavigateTo>d__6.MoveNext()

    There are a few strange things. First of all, I indeed use LicenseInfo in Module_OnNavigateTo function but I do ensure to use CurrentAppSimulator only in development by having in using next lines

    #if !RELEASE
    using CurrentAppStore = Windows.ApplicationModel.Store.CurrentAppSimulator;
    #else
    using CurrentAppStore = Windows.ApplicationModel.Store.CurrentApp;
    #endif

    So the question is why in the error trace CurrentAppSimulator is present instead of the CurrentApp and if Microsoft somehow manages to  launch app in debug mode why it has Access_Denied error?

    There were 10 such messages in about 5 min timespan so i is not due to some accidental temporary restriction.

    Saturday, September 6, 2014 6:07 AM

Answers

  • There isn't a standard RELEASE constant defined. Unless you're defining it yourself you'll always compile the !RELEASE branch and use CurrentAppSimulator.

    There is a standard DEBUG constant defined by default in debug modes (controlled from the Build properties page). Typically you'd reverse the logic you have:

    #if DEBUG
     using CurrentAppStore = Windows.ApplicationModel.Store.CurrentAppSimulator;
    #else
     using CurrentAppStore = Windows.ApplicationModel.Store.CurrentApp;
    #endif 

    --Rob

    • Marked as answer by Yuriy Laschuk Saturday, September 6, 2014 7:04 AM
    Saturday, September 6, 2014 6:49 AM

All replies

  • There isn't a standard RELEASE constant defined. Unless you're defining it yourself you'll always compile the !RELEASE branch and use CurrentAppSimulator.

    There is a standard DEBUG constant defined by default in debug modes (controlled from the Build properties page). Typically you'd reverse the logic you have:

    #if DEBUG
     using CurrentAppStore = Windows.ApplicationModel.Store.CurrentAppSimulator;
    #else
     using CurrentAppStore = Windows.ApplicationModel.Store.CurrentApp;
    #endif 

    --Rob

    • Marked as answer by Yuriy Laschuk Saturday, September 6, 2014 7:04 AM
    Saturday, September 6, 2014 6:49 AM
  • Yes, Rob, you are right. Shame on me I even did not pay attention that #else clause remained inactive gray  even after changing to Release mode, so my app resubmitted 4-th time.
    Saturday, September 6, 2014 7:04 AM