← All platforms

WPF error tracking

A button click shouldn’t leave you guessing what broke. The Sentry .NET SDK sends WPF exception reports to Telebugs on your server.

~/hoofnotes  dotnet add package Sentry
~/hoofnotes  nvim App.xaml.cs
using System;
using System.Windows;
using Sentry;
public partial class App : Application
{
private readonly IDisposable _sentry;
public App()
{
_sentry = SentrySdk.Init(options =>
{
// Copy the complete DSN, key and path included.
options.Dsn = "YOUR_TELEBUGS_DSN";
options.IsGlobalModeEnabled = true;
});
DispatcherUnhandledException += (_, e) =>
SentrySdk.CaptureException(e.Exception);
Exit += (_, _) => _sentry.Dispose();
}
}
~/hoofnotes  dotnet build

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep Sentry and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

What about UI dispatcher exceptions?

WPF has a dispatcher error hook that can report through the SDK. Your application decides whether it can safely recover; capturing an exception doesn’t mean it is safe to ignore.

What kind of reports are supported?

Managed .NET exceptions with the backtraces the SDK sends. This is not a native crash-dump symbolication service. Your Windows app needs network access to your Telebugs server.