1

I've an application (UWP) that seems to have something broken during resuming event, but I can't understand what because the debugger is not called when I try to resume it.

I'm using mvvmlight and a custom frame, and I register handlers to resuming and suspending events in app.xaml.cs.

My app populate a list of items when it execute the splashscreen on the first time, this process is executed in background with an async method.

I'm using the SuspensionManager class as suggested in msdn https://msdn.microsoft.com/en-us/library/windows/apps/hh986968.aspx registering the frame immediately after it's created. I don't know why but when I put my app in suspend state (pressing "suspending" or "suspending and terminate" button in visual studio) and then when I resume it using the button in the same dropdown, I can't see the debugger executing my breakpoint that I set in Onlaunched and in App_Resuming of my App.xaml.cs.

On my device (I'm testing it on WP8.1) it only shows "app is resuming" and visual studio tell me that the operation is taking more time that expected. What can I do to understand what's going wrong? I can't see any exception or errors during the suspending event that seems to complete its tasks correctly

Caio
  • 61
  • 5
  • Do you have a minimal repro you can post to show the error? – Peter Torr - MSFT Sep 23 '15 at 01:26
  • Have you tried to debug the event by using *Lifecycle Tab* -> Suspend/Resume? – Romasz Sep 23 '15 at 04:50
  • @Peter no because I don't see any error: only the black screen with "resuming" word in center of my phone (in addiction I can add the visual studio screenshot telling that is taking longer...) – Caio Sep 23 '15 at 07:31
  • @Romasz yes I'm doing suspend and resume with special visual studio buttons – Caio Sep 23 '15 at 07:32
  • If you don't register to resuming event, does the app resume or also hangs? You only register in app.xaml.cs? – Romasz Sep 23 '15 at 08:39
  • No I have the same problem even if I don't register the handler;I also tried to register it in the page where the app should be resumed but I doesn't work – Caio Sep 23 '15 at 14:28
  • I assume if you do **File** -> **New Project** it works. Then you start adding code, bit by bit, testing each time. When it stops working, you have a minimal repro you can post. – Peter Torr - MSFT Sep 24 '15 at 01:49
  • I've a solution that consists of 9 projects and dozens of file now, is not reasonable to restart adding code step by step, I should have to put a lot of hours to reproduce the problem. Is it possible that Microsoft doesn't provide nothing that I can do to track or log the problem???? – Caio Sep 24 '15 at 07:40
  • Normally you should be able to test it with the buttons you now use. Maybe your app never gets to resuming event? Are you using/relesing deferral at Suspending event? Have you tried without registering suspending event? Maybe there is a problem with some static variables? – Romasz Sep 24 '15 at 08:09
  • Yes, my app never gets to resuming event, I put some debug writeline inside but it never execute it. Yes I'm using deferral on suspending and I've added also SuspensionManager class to improve this process: `var deferral = e.SuspendingOperation.GetDeferral(); await SuspensionManager.SaveAsync(); deferral.Complete();` I alredy tried without register any event related to suspend o resume, but nothing changed. Why do you ask me about static variables? I use them in mvvmlight of course, could they cause problems? – Caio Sep 24 '15 at 12:00

0 Answers0