Recently I blogged about Error reporting for Windows Phone 7 : Little Watson but when I was using it for the Slime Sweeper V2 , i realised its not as simple as copying and paste the framework over to XNA and use it. We have to introduce some extra stuffs.
We have to add Microsoft.Phone and System.Windows references into the project. The codes are similar but we do not have native MessageBox.Show and Application.Current.UnhandledException in the project like what we have on Silverlight project and hence we have to add them differently to the project.
In the constructor of the game, we have to add this code.
Application.Current.UnhandledException += (s, e) =>
// We do not want to throw exceptions in our exception handler
and as for MessageBox.Show, I am using Guide.BeginShowMessageBox method.
You can download the sample code which I have built here, the button will crash the application and when you try to go into the application again from the emulator, a messagebox will appear :
If you have any feedback or question, feel free to contact me via the contact me form or email me at [email protected]