capturing dump on Windows Phone 8.1

大憨熊 提交于 2019-12-07 14:26:37

问题


I am developing a Windows Phone 8.1 app. I want to add a functionality that whenever the app crashes a memory dump is captured and written to a log.

I want to know if there is any way to log the crash dump while the user is using the app on his phone and it crashes. I found this question which is similar to mine but is for Windows 8. It says that we can use the 'Application_UnhandledException' method in App.xaml.cs to obtain the dump. But is this method supported in Windows Phone 8.1 too because I didn't see this in the auto-generated content of App.xaml.cs(which is generated by Visual Studio and contains functions like OnActivated, OnLaunched etc.)

Does the UnhandledException event handler do this thing in Windows Phone 8.1?


回答1:


The Silverlight 8.1 App.xaml.cs class has an UnhandledException event handler just like 8.0.

WinRT 8.1 apps on the other hand require you to add the handler yourself.

To do this, go to App.xaml.cs and in the constructor, add the following:

this.UnhandledException += App_UnhandledException;

Also add this event handler:

private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        // Save the dump here.
    }



回答2:


Do you require explicit dump handling on your own? If you publish through Store you should already be able to access "dumps" (more like stack-traces) from your Store accounts quality page.

http://msdn.microsoft.com/en-us/library/windows/apps/hh967782.aspx

http://blogs.msdn.com/b/windowsstore/archive/2012/06/27/improving-apps-with-quality-reports.aspx



来源:https://stackoverflow.com/questions/23891708/capturing-dump-on-windows-phone-8-1

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