Skip to content

W8 WP8 UAP UWP

Davide Benvegnù edited this page Nov 14, 2019 · 5 revisions

Windows 8/8.1, Windows Phone 8/8.1, Universal Apps 8.1 and Universal Windows Platform (Windows 10)

To add automatic bugs interception on any Unhandled Exception on W8, WP8, UAP and UWP you need to register a new UnhandledExceptionEventHandler.

You can do it in the very beginning of the App class ctor.

public App()
{
    this.InitializeComponent();
    this.UnhandledException += BugGuardianExceptionTrapper;
    this.Suspending += this.OnSuspending;
    
    [...]
    //Your code here
    [....]
}

private void BugGuardianExceptionTrapper(object sender, UnhandledExceptionEventArgs e)
{
    using (var manager = new DBTek.BugGuardian.BugGuardianManager())
    {
        manager.AddBug(e.Exception);
    }
}

Warning

Remember to check the configuration page to have info on how to set the BugGuardian setting parameters via Code (required for this kind of app).