.NET Standard .NET icon for BugSplat

BugSplatDotNetStandard allows you to capture and track exceptions on all .NET Standard 2.0 platforms. This includes:

  • .NET Core
  • Universal Windows Platform (UWP)
  • Xamarin
  • Mono

Configuration


You can find information on how to install the BugSplatDotNetStandard NuGet package here.

After you've installed the BugSplatDotNetStandard package, add a using statement for the BugSplatDotNetStandard namespace.

using BugSplatDotNetStandard;

Create a new instance of BugSplat providing it your application's name, version and the corresponding BugSplat database. It's best to do this at the entry point of your application:

var bugSplat = new BugSplat(appName, appVersion, database);

Add a new listener to your application's UnhandledException event. In the event listener, add a call to BugSplat's Post method, making sure to pass in the exception that was unhandled. It is recommended that you close your application after an UnhandledException. In the following example from our MyUwpCrasher sample, we mark the exception as handled so that we can await the call to Post and shutdown the application immediately after:

this.UnhandledException += async (sender, args) =>
{
    args.Handled = true;
    await bugSplat.Post(args.Exception);
    CoreApplication.Exit();
};

You can also configure BugSplat to upload log files at crash time. You can add as many files as you'd like, but the upload size limit is 2 MB for standard customers and 10 MB for Enterprise customers:

bugSplat.AttachFile(new FileInfo("/path/to/file.txt"));

Testing the Integration


To test the integration, throw a new Exception outside of a try catch block:

throw new Exception("BugSplat rocks!");

You can also use BugSplat to manually post errors from a catch block:

try
{
    throw new Exception("BugSplat rocks!");
}
catch (Exception ex) 
{
    await bugSplat.Post(ex);
}

Once you've generated an error, navigate to the BugSplat Dashboard and ensure you have to correct database selected in the dropdown menu. You should see a new crash report under the 'Most Recent Crashes' section:

dashboard example for dot net standard

Click the link in the ID column to see details about the crash:

crash example for dot net standard

That’s it! Your application is now configured to post crash reports to BugSplat.

If you have any additional questions please reach out to our support team.