This is a mirror of official site: http://jasper-net.blogspot.com/

Simple Error Reporting on WP7

| Wednesday, February 9, 2011
“It's not a bug - it's an undocumented feature “

Unfortunately, the sad fact is that we all make mistakes! How can we make our Windows Phone 7 Application send us error reports? Why not just email it to yourself?

Here is a simple code snippet to get you started:

private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
   if (System.Diagnostics.Debugger.IsAttached)
   {
       System.Diagnostics.Debugger.Break();
   }

   e.Handled = true;
   Microsoft.Phone.Tasks.EmailComposeTask task = new Microsoft.Phone.Tasks.EmailComposeTask();
   task.Body = e.Exception.Message;
   task.Subject = "Error Report";
   task.To = "support@myCoolWP7App.com";
   task.Show();
}


Read more: Rudi Grobler in the Cloud

Posted via email from Jasper-net

0 comments: