locked
Debugging Suspend / Resume RRS feed

  • Question

  • I know this has been discussed already, but I can't seem to get this to work properly.  I am trying to debug the suspend/resume events for my application using the Suspend / Resume buttons in Visual Studio.  When I click on Suspend, the breakpoint in my oncheckpoint handler is reached as expected.  However, when I click on Resume, the breakpoint in my activated event is not reached.  Is anyone else having trouble with this, or am I doing something wrong?

    Dave Paquette @Dave_Paquette www.davepaquette.com

    Tuesday, June 19, 2012 1:01 PM

Answers

  • The resume button will only fire the Windows.UI.WebUI.WebUIApplication.onresuming event; it won't trigger the activated event. As Jeff points out, you have to simulate terminating the app then restarting it to see the activated handler called with previousExecutionState == terminated.

    To be clear, resuming means only giving the app CPU time again after it's being suspended. This will never call the activated handler. Activation only happens again if the app has been terminated while suspended.

    Tuesday, June 19, 2012 2:21 PM

All replies

  • After suspending, then hit the stop button to stop debugging.  Then start debugging again and you will notice your app is starting as if it was resumed.

    Jeff Sanders (MSFT)

    Tuesday, June 19, 2012 1:08 PM
    Moderator
  • The resume button will only fire the Windows.UI.WebUI.WebUIApplication.onresuming event; it won't trigger the activated event. As Jeff points out, you have to simulate terminating the app then restarting it to see the activated handler called with previousExecutionState == terminated.

    To be clear, resuming means only giving the app CPU time again after it's being suspended. This will never call the activated handler. Activation only happens again if the app has been terminated while suspended.

    Tuesday, June 19, 2012 2:21 PM
  • Awesome clarification Kraig, thanks!

    Jeff Sanders (MSFT)

    Tuesday, June 19, 2012 2:23 PM
    Moderator
  • Thanks for clearing that up Jeff and Kraig.

    Dave Paquette @Dave_Paquette www.davepaquette.com

    Tuesday, June 19, 2012 2:30 PM
  • I know this is an old thread, but there may be a new issue with the Application Certification Kit (ACK) as of June/July 2013. Even if I don't have any Suspend code, my app fails certification. I pointed this out to the testing team and they passed my app. However, whoever's on THE ACK team at Microsoft should take a look at the issue... not sure who to tell.

    Best,

    -Auri

    Check out "Fu" for Facebook uploading in Win8! | Author, Hacking the PSP & Geek My Ride | President, The Auri Group, LLC, www.aurigroup.com | Blog: http://auri.me

    Friday, July 19, 2013 4:36 PM