AvinashK
AvinashK

Reputation: 3423

capturing dump on Windows Phone 8.1

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?

Upvotes: 3

Views: 1089

Answers (2)

Ertay Shashko
Ertay Shashko

Reputation: 1257

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.
    }

Upvotes: 5

Niclas
Niclas

Reputation: 1230

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

Upvotes: 0

Related Questions