Send crash reports of your desktop application developed using .NET 10 or .NET Framework directly to your mail's inbox with full exception report, stack trace and screenshot.
| Target | Notes |
|---|---|
net10.0-windows |
Windows Forms and WPF applications on .NET 10. |
net48 |
Windows Forms and WPF applications on .NET Framework 4.8. |
RetryFailedReportsAsync(CancellationToken)retries failed reports without blocking the UI thread. The synchronousRetryFailedReports()still works, but blocks until all reports are sent.- Failed reports are resent exactly as they were captured, including the original screenshot, application version, developer message and what the user typed. Retrying no longer takes a new screenshot.
- Failed reports are queued per application in
%TEMP%\CrashReporterNET\<application name>\, with unique file names, and are written atomically. Exception messages containing control characters no longer prevent a report from being saved. - E-mail reports, saved HTML reports and the crash dialog show Windows 11 correctly: Windows 11 still reports version 10.0 and its registry product name still says "Windows 10", so the name is now derived from the build number (22000 or later) on workstation editions. Doctor Dump receives the unchanged numeric version (e.g.
10.0.22631); how its dashboard labels that version is up to the service. - Only one retry per application runs at a time, also across processes, so a report is never sent twice by overlapping retries. Each retried report must be delivered within
DeliveryTimeout(100 seconds by default), and cancellingRetryFailedReportsAsyncalso interrupts an SMTP delivery in progress on .NET Framework. - Doctor Dump retries report the application title and version that crashed, not the version running when the report is retried.
- The Save report button embeds the screenshot in the saved HTML file when Include screenshot is checked.
- When
AnalyzeWithDoctorDumpisfalse, the crash dialog no longer sends an anonymous report to Doctor Dump. - Doctor Dump responses are validated: HTTP errors, SOAP faults and empty responses are reported as errors instead of being treated as success.
CrashReporter.NET.dllis always strong-name signed with the key committed in this repository (public key tokendee93ec6287efbf0). This identity differs from the upstreamCrashReporter.NET.Officialpackage, which was signed with RBSoft's private key. Versions 2.0.0 and 2.0.1 ofd3sync.CrashReporter.NETwere not signed; strong-named applications need 2.1.0 or later.- Reports saved by 2.0.x in
%TEMP%\CrashReporterNET\(not in an application folder) are not retried.
Version 2.0 is a breaking release:
- Support for .NET Framework 2.0, 3.5, 4.0 and 4.5.2 was dropped. Use version 1.6 if you need those.
- The public Doctor Dump web service proxy types generated by the old Visual Studio "Web Reference" (
HttpsCrashReporterReportUploader,HttpCrashReporterReportUploader,SendAnonymousReportCompletedEventArgs,SendAdditionalDataCompletedEventArgsand their event handler delegates) were removed. The data contract types inCrashReporterDotNET.com.drdump(Response,ErrorResponse, etc.) are unchanged. - Failed reports saved by
SaveFailedReport()are now stored asfailed-report-*.xmlinstead ofBinaryFormatterbased.binfiles, becauseBinaryFormatteris no longer available on .NET 9+. Old.binfiles are not retried. - Translations are now shipped as standard satellite assemblies (
de\CrashReporter.NET.resources.dll, etc.) instead of being embedded inCrashReporter.NET.dll. Deploy the culture folders along with your application.
PM> Install-Package d3sync.CrashReporter.NETCrashReporter.NET uses the exception information like stack trace, exception type, message, source, .NET CLR version, OS version and application version to generate the crash report and send it to developer using email. It uses DoctorDump service to send email to developer. Developers can use their SMTP server to send email too.
First thing you need to do is subscribe to Application.ThreadException and AppDomain.CurrentDomain.UnhandledException in your Program.cs file as shown below.
static class Program
{
private static ReportCrash _reportCrash;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.ThreadException += (sender, args) => SendReport(args.Exception);
AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
{
SendReport((Exception)args.ExceptionObject);
};
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
_reportCrash = new ReportCrash("Email where you want to receive crash reports")
{
Silent = true,
ShowScreenshotTab = true,
IncludeScreenshot = false,
#region Optional Configuration
WebProxy = new WebProxy("Web proxy address, if needed"),
AnalyzeWithDoctorDump = true,
DoctorDumpSettings = new DoctorDumpSettings
{
ApplicationID = new Guid("Application ID you received from DrDump.com"),
OpenReportInBrowser = true
}
#endregion
};
_reportCrash.RetryFailedReports();
Application.Run(new FormMain());
}
public static void SendReport(Exception exception, string developerMessage = "")
{
_reportCrash.DeveloperMessage = developerMessage;
_reportCrash.Silent = false;
_reportCrash.Send(exception);
}
public static void SendReportSilently(Exception exception, string developerMessage = "")
{
_reportCrash.DeveloperMessage = developerMessage;
_reportCrash.Silent = true;
_reportCrash.Send(exception);
}
}Just set the ToEmail in above example with your email to start receiving crash reports.
If you want to handle exception report for individual exception with special message you can do it like shown below.
const string path = "test.txt";
try
{
if (!File.Exists(path))
{
throw new FileNotFoundException(
"File Not found when trying to write argument exception to the file", argumentException);
}
}
catch (Exception exception)
{
Program.SendReport(exception, "Value of path variable is " + path);
}First thing you need to do is subscribe to AppDomain.CurrentDomain.UnhandledException in your App.xaml.cs file as shown below.
public partial class App : Application
{
private static ReportCrash _reportCrash;
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
Application.Current.DispatcherUnhandledException += DispatcherOnUnhandledException;
TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
_reportCrash = new ReportCrash("Email where you want to receive crash reports")
{
Silent = true
};
// Retry reports that could not be sent earlier, in the background so startup is not blocked.
_ = _reportCrash.RetryFailedReportsAsync();
}
private void TaskSchedulerOnUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs unobservedTaskExceptionEventArgs)
{
SendReport(unobservedTaskExceptionEventArgs.Exception);
}
private void DispatcherOnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs dispatcherUnhandledExceptionEventArgs)
{
SendReport(dispatcherUnhandledExceptionEventArgs.Exception);
}
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
{
SendReport((Exception)unhandledExceptionEventArgs.ExceptionObject);
}
public static void SendReport(Exception exception, string developerMessage = "")
{
_reportCrash.Silent = false;
_reportCrash.Send(exception);
}
public static void SendReportSilently(Exception exception, string developerMessage = "")
{
_reportCrash.Silent = true;
_reportCrash.Send(exception);
}
}Just set the ToEmail in above example with your email to start receiving crash reports.
If you want to handle exception report for individual exception with special message you can do it like shown below.
const string path = "test.txt";
try
{
if (!File.Exists(path))
{
throw new FileNotFoundException(
"File Not found when trying to write argument exception to the file", argumentException);
}
}
catch (Exception exception)
{
App.SendReport(exception, "Value of path variable is " + path);
}You can show screenshot tab by setting ShowScreenshotTab to true. It will be false by default.
reportCrash.ShowScreenshotTab = trueYou can set the IncludeScreenshot value to false if you don't want to include screenshot in the crash report. If you are showing the screenshot tab then user can still choose to include the screenshot even if you set it to false.
reportCrash.IncludeScreenshot = false;You can send crash reports silently by setting Silent property to true.
reportCrash.Silent = true;You can send crash report using a web proxy by adding following line in SendReport method.
reportCrash.WebProxy = new WebProxy("Web proxy address"),You can send crash report to you doctor dump account by adding following line in SendReport method.
reportCrash.DoctorDumpSettings = new DoctorDumpSettings
{
ApplicationID = new Guid("Application ID you received from DrDump.com"),
};Just set the ApplicationID to ID you received from DrDump.com.
You can take screenshot of whole screen instead of only application when application crashes by adding following line in SendReport method.
reportCrash.CaptureScreen = true;You can use the SMTP server instead of DrDump service to send crash reports as shown below.
var reportCrash = new ReportCrash
{
AnalyzeWithDoctorDump = false,
SmtpHost = "smtp.gmail.com",
Port = 587,
EnableSSL = true,
UserName = "Your Gmail account email",
Password = "Your Gmail account password",
ToEmail = "Email address where you want receive crash reports",
FromEmail = "Your Gmail account email or alias"
};