Skip to content

WindowsStoreAppCrashHandler

mbrit edited this page Sep 17, 2012 · 3 revisions

The recommended behaviour of Windows Store apps is that if an exception occurs, the app is supposed to immediately close and redirect you to the Start screen. (The fact that the app has disappeared is supposed to tip the user off to the fact that an error has occurred.)

The GlobalCrashHandler can be used to ensure that a FATAL log entry is written if an unhandled exception occurs.

    public App()
    {
        this.InitializeComponent();
        this.Suspending += OnSuspending;

        // setup the global crash handler...
        GlobalCrashHandler.Configure();
    }

The operation of this method is to: write a FATAL entry, wait until all of the targets have finished writing, then call Application.Exit.

Clone this wiki locally