Windows Store Apps: my app terminates after being switched

我们两清 提交于 2019-12-31 05:48:07

问题


I'm building a Windows 8 app.

My problem is when the user switches to another app or goes to start, the app terminates. In the side bar I find the preview of the app to be displaying the splash screen, when I click on the app it starts from the beginning.

What can be the problem here, could it be a memory issue ? In the task manager my app takes 40 MB of memory, is that too much ?


EDIT


The Event Viewer shows the following when the app crashes:

Application: MyApp.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: MyApp.Common.SuspensionManagerException Stack: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Threading.WinRTSynchronizationContext+Invoker.b__0(System.Object) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()


回答1:


From your stack trace it looks like the suspension manager is throwing an exception. The most common cause of exceptions I've found in the suspension manager is in trying to pass complex objects between pages as a navigation parameter. If you are passing a complete business object around, then try just passing the ID. I know it's crazy, but that's the way it is with the default implementation.



来源:https://stackoverflow.com/questions/20049589/windows-store-apps-my-app-terminates-after-being-switched

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!