Add Bugsnag to your WPF applications.
1.4.0of Bugsnag.dll located within the
bugsnag.zipfile. Make sure to reference it in your project.
Bugsnag for .NET depends only on the
JSON.net library and needs to be
referenced, the nuget package can be found
Configure the Bugsnag integration inside your
<configuration> <configSections> <section name="bugsnagConfig" type="Bugsnag.ConfigurationStorage.ConfigSection, Bugsnag" /> </configSections> <bugsnagConfig apiKey="your-api-key-goes-here" /> </configuration>
Import the Bugsnag clients namespace into your application
OnStartup function call the
WPFClient.Start() method. Normally, this can be done in the
If you would like to send non-fatal exceptions to Bugsnag, you can pass any
object that inherits from
Exception to the
It is often helpful to send us additional application-specific diagnostic data. This can be accomplished as per the following example:
var metadata = new Metadata(); metadata.AddToTab("Resources", "Datastore Entries", myDataStore.Count()); metadata.AddToTab("Resources", "Threads Running", threads.Count()); metadata.AddToTab("Resources", "Throttling Enabled", false); WPFClient.Notify(new ArgumentException("Non-fatal"), metadata);
You can set the severity of an error in Bugsnag by including the severity option when notifying bugsnag of the error,
WPFClient.Notify(new ArgumentException("Non-fatal"), Severity.Info)
Valid severities are
Severity is displayed in the dashboard and can be used to filter the error list.
By default all crashes (or unhandled exceptions) are set to
WPFClient.Notify() calls default to
The client can be configured to send the users ID, email and name with every notification. The user ID should be set to something unique to the user e.g. a generated GUID.
WPFClient.Config.SetUser("d7b4aadd", "firstname.lastname@example.org", "Anthony Michaels");
Bugsnag can track the number of “sessions” that happen in your application. This enables Bugsnag to provide and compare stability scores between releases to help you understand the quality of your releases.
Session tracking is coming soon to this platform.