Wednesday, March 23, 2011

WP7 Devs- Ever get tired of dealing with the locked screen when you press F5?

There's an easy way to avoid ever having a deployment/debugging session aborted due to a locked screen. As you know, Windows Phone doesn't let us turn off the screensaver. If you are like me, you also don't want to disable & re-enter your password all the time either.

There's an easy fix for this problem though.

Just create a generic XNA game project called "StopLock" or whatever suits you, and this line to the Game constructor:

Guide.IsScreenSaverEnabled = false;

Build the project, deploy it, and run it before you start a coding session. When the game you are actually working on is started by the debugger, it will never give you any errors due to the device being locked because StopLock will have kept it open. When your program terminates, it will resume the StopLock app which will once again disable the screen saver.


  1. genius. will it work as a xap? or does it have to be deployed from VS?

  2. Once you run it once from the debugger it will be on your phone's app menu but I don't see any reason why you couldn't install it as a xap too if you wanted.

  3. After a few people suggested it I decided to make this an app which I put on the marketplace. You don't even have to bother making it now, just download it from here and forget about having the phone locked when you are working on your app.