0

I work on a UWP app that is built for Xbox. I would like to make it crash so that I confirm that crash reporting is working correctly. I've set up button that calls this code:

Object obj = null;
obj.ToString();

If I deploy the app to my Windows 10 laptop and click my "crash" button, the app crashes (disappears), as I expect. However, when deployed to an Xbox (in dev mode) after clicking that button the app hangs for a few seconds and then becomes responsive again and doesn't crash.

Any thoughts why this would happen on the Xbox?

Scott
  • 1,011
  • 1
  • 15
  • 30

1 Answers1

1

Not sure why, but on Xbox if that crash code is on the UI thread, it won't kill the app.

I solved this by creating a new thread and bow the app crashes as I need it to.

public static void CrashTheApp()
{
    Object obj = null;
    obj.ToString();
}

private void CrashTheApp_Click(object sender, RoutedEventArgs e)
{ 
    Thread thread = new Thread(App.CrashTheApp);
    thread.Start();
}
Scott
  • 1,011
  • 1
  • 15
  • 30
  • If you have resolved your issue please [mark](https://meta.stackexchange.com/a/5235) it as accepted to convenient people who visit this thread later – Faywang - MSFT Oct 15 '19 at 06:09