locked
windows store app moves to not responding state after suspending.

    Question

  • After suspending the windows store app, app goes to Not Responding state. I have tried this by suspending through VisualStudio and Windows OS suspend the app if the app is not used for sometime. but if we resume the app it is working correctly.

    Any idea about why the app moves to Not responding state when suspending??

    -Santyy




    • Edited by Santyyz Wednesday, April 09, 2014 10:54 AM spell change
    Wednesday, April 09, 2014 10:52 AM

All replies

  • can you show some code in the suspending method? did you tried to debug it? maybe deadlocking?

    are you using .Wait or .Result from task objects there?


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, April 09, 2014 11:38 AM
  • Below is the code in OnSuspending method.

      var deferral = e.SuspendingOperation.GetDeferral();
                await SuspensionManager.SaveAsync();
                deferral.Complete();

    i have tried by commenting the line

    await SuspensionManager.SaveAsync();

    that also leads to Not Responding state.

    Santyy


    Santyy

    Wednesday, April 09, 2014 11:51 AM
  • is you debug it, is that code reached?

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, April 09, 2014 11:56 AM
  • Yes i debugged it and that code reached.


    Santyy

    Wednesday, April 09, 2014 12:39 PM
  • Oops, we need some more information for knowing where is the problem locates, could you try to create a new blank app and set your deferral() code inside to see if the app still no responding.

    If yes, probably the issue is on your environment.

    If no, could you plz provide us a reproducible demo for test?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, April 17, 2014 10:21 AM
    Moderator
  • I managed to reproduce this behaviour.

    Steps to reproduce:

    1. Create "Blank application" (Blank app XAML template C++)

    2. Add the following two lines to its OnSuspending handler:

    SuspendingDeferral^ deferral = e->SuspendingOperation->GetDeferral();

    deferral->Complete();

    To have the effect easily visible do the following:

    a. have the remote machine ready for the remote debugging;

    b. run Task Manager on it.

    3. Run the app in Visual Studio debugger on the remote machine.

    4. Press Suspend button in Visual Studio.

    5. Switch to the Task manager on the remote machine. You will see the app in "Not responding" state rather than "suspended".

    Wednesday, June 04, 2014 11:06 AM
  • Is there anything new on the subject? So far I get this behavior in every Store or Universal app sample I tried, without modifying it.
    Wednesday, November 05, 2014 6:45 PM