Windows Phone app crashes only if downloaded from the store

自古美人都是妖i 提交于 2019-12-10 14:12:09

问题


I have a really strange problem, I developed a windows phone app that works perfectly if installed from visual studio... I uploaded on the store as beta, installed from the store, but the app crashes always on splashscreen!

Thanks


回答1:


If you're application uses a periodic Background Agent and you are testing it with the LaunchForTest method you should make sure that you are not calling this in your release build of the code.
Protect it with appropriate conditional compile time checks:

#if DEBUG
ScheduledActionService.LaunchForTest(periodicTaskName, TimeSpan.FromSeconds(1)); 
#endif

Note that DEBUG is defined by default in the "Debug" configuration and not in the "Release" one for situations such as this.

It would be nice if the automated tests done by the marketplace/store detected this but currently they don't. Maybe one day...




回答2:


It could be that your app takes longer than 4 seconds to become usable. During debugging that requirement is disabled, but when it's on the store your app needs to be snappy.




回答3:


Thank you so much guys, yes the problem was the ScheduledActionService.LaunchForTest, now I commented all code this way:

//#define DEBUG_AGENT

 //#if(DEBUG_AGENT)
        //ScheduledActionService.LaunchForTest(periodicTaskName, TimeSpan.FromSeconds(1)); 
        //#endif

Do you think that i can uncomment the second part, this way:

//#define DEBUG_AGENT

 #if(DEBUG_AGENT)
        ScheduledActionService.LaunchForTest(periodicTaskName, TimeSpan.FromSeconds(1)); 
        #endif

Do the app will work the same?

THANKS !!!



来源:https://stackoverflow.com/questions/15274083/windows-phone-app-crashes-only-if-downloaded-from-the-store

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!