Monday, November 8, 2010

Debugging without the Debugger

I had a problem, my app worked well in the debugger, when I submitted it to the Marketplace it failed as it would not run on the phone.  I then tried to deploy it to the phone emulator, and it did not run there either.

I then figured I should rebuild the App piece by piece and check each step to see if it deployed and ran on the emulator.  I then found the method (function) that caused the trouble.

I put a trial mode in my app, and tested by faking a trial mode with a settings object saved in IsolatedStorageSettings.  My problem was I was storing the setting in Isolated Storage with a guard clause checking for the debugger (not deployed), when I did the test in the code I did not include the debugger guard clause.  So when running in the Debugger everything worked, when deployed it crashed on trying to get the isTrial setting.



IsTrial blog entry by a Microsoft Phone "evangelist", Jeff's 31 days of Windows phone is an excellent introduction to writing apps for the Windows Phone.

http://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7c-Day-23-Providing-Trial-Versions-of-Your-App.aspx

No comments:

Post a Comment