在Windows Phone 8.1上捕获转储

我正在开发一个Windows Phone 8.1应用程序。 我想添加一个function, 每当应用程序崩溃时,捕获内存转储并将其写入日志

我想知道当用户在手机上使用应用程序并且崩溃时,是否有任何方法可以记录崩溃转储。 我发现这个问题与我的相似,但适用于Windows 8 。 它说我们可以在App.xaml.cs中使用‘Application_UnhandledException’方法来获取转储。 但这种方法是否也支持Windows Phone 8.1,因为我没有在App.xaml.cs的自动生成内容中看到这一点(由Visual Studio生成并包含OnActivated,OnLaunched等function)

UnhandledException事件处理程序是否在Windows Phone 8.1中执行此操作?

Silverlight 8.1 App.xaml.cs类有一个像8.0​​一样的UnhandledException事件处理程序。

另一方面,WinRT 8.1应用程序要求您自己添加处理程序。

为此,请转到App.xaml.cs并在构造函数中添加以下内容:

this.UnhandledException += App_UnhandledException; 

还要添加此事件处理程序:

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

您是否需要自己进行显式转储处理? 如果您通过商店发布,则您应该已经能够从商店帐户质量页面访问“转储”(更像是堆栈跟踪)。

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