All Projects → ravibpatel → Crashreporter.net

ravibpatel / Crashreporter.net

Licence: mit
Send crash reports of your classic desktop application developed using .NET Framework directly to your mail's inbox with full exception report, stack trace and screenshot.

Projects that are alternatives of or similar to Crashreporter.net

xamarin-bugly
A bugly SDK for Xamarin Android Bindings
Stars: ✭ 22 (-83.58%)
Mutual labels:  nuget, crash-reports
Autoupdater.net
AutoUpdater.NET is a class library that allows .NET developers to easily add auto update functionality to their classic desktop application projects.
Stars: ✭ 1,958 (+1361.19%)
Mutual labels:  nuget, desktop-application
Bugtrap
🐞 BugTrap: Catch unhandled exceptions in unmanaged and managed .NET code.
Stars: ✭ 114 (-14.93%)
Mutual labels:  crash-reports
Xamarin.forms.breadcrumb
This is a breadcrumb navigation control that is complete automatic and uses the Navigation stack and page titles to generate the breadcrumbs.
Stars: ✭ 130 (-2.99%)
Mutual labels:  nuget
Exoplayerxamarin
Xamarin bindings library for the Google ExoPlayer library
Stars: ✭ 124 (-7.46%)
Mutual labels:  nuget
Dotnet Tools
A list of tools to extend the .NET Core command line (dotnet)
Stars: ✭ 1,551 (+1057.46%)
Mutual labels:  nuget
Baget
A lightweight NuGet and symbol server
Stars: ✭ 1,861 (+1288.81%)
Mutual labels:  nuget
Zetalongpaths
A .NET library to access files and directories with more than 260 characters length.
Stars: ✭ 113 (-15.67%)
Mutual labels:  nuget
Electron Python Example
Electron as GUI of Python Applications
Stars: ✭ 1,749 (+1205.22%)
Mutual labels:  desktop-application
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (-9.7%)
Mutual labels:  nuget
Chirp
🐦 A cross platform twitter application
Stars: ✭ 129 (-3.73%)
Mutual labels:  desktop-application
Recaptcha.aspnetcore
Google reCAPTCHA v2/v3 for .NET Core 3.x
Stars: ✭ 122 (-8.96%)
Mutual labels:  nuget
Sentry Php
The official PHP SDK for Sentry (sentry.io)
Stars: ✭ 1,591 (+1087.31%)
Mutual labels:  crash-reports
Youtube2audio
Desktop application to download YouTube videos as annotated MP3 or MP4 files
Stars: ✭ 128 (-4.48%)
Mutual labels:  desktop-application
Aura.ui
A Library with a lot of Controls for AvaloniaUI
Stars: ✭ 114 (-14.93%)
Mutual labels:  nuget
Nsdepcop
NsDepCop is a static code analysis tool that helps to enforce namespace dependency rules in C# projects. No more unplanned or unnoticed dependencies in your system.
Stars: ✭ 114 (-14.93%)
Mutual labels:  nuget
Menu
A JavaScript free menu library for Blazor and Razor Components applications.
Stars: ✭ 118 (-11.94%)
Mutual labels:  nuget
Watsonwebserver
Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
Stars: ✭ 125 (-6.72%)
Mutual labels:  nuget
Sessionstorage
A library to provide access to session storage in Blazor applications
Stars: ✭ 132 (-1.49%)
Mutual labels:  nuget
Xamarin Crossdownloadmanager
A cross platform download manager for Xamarin
Stars: ✭ 131 (-2.24%)
Mutual labels:  nuget

CrashReporter.NET

AppVeyor branch

Send crash reports of your classic desktop application developed using .NET Framework directly to your mail's inbox with full exception report, stack trace and screenshot.

The nuget package NuGet NuGet

PM> Install-Package CrashReporter.NET.Official

How it works

CrashReporter.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.

Using the code

Windows Forms Application

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);
}

WPF Application

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
        };
        _reportCrash.RetryFailedReports();
    }

    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);
}

Configuration Options

Show screenshot tab

You can show screenshot tab by setting ShowScreenshotTab to true. It will be false by default.

reportCrash.ShowScreenshotTab = true

Include screenshot with crash report

You 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;

Send reports silently

You can send crash reports silently by setting Silent property to true.

reportCrash.Silent = true;

Send reports using a web proxy

You can send crash report using a web proxy by adding following line in SendReport method.

reportCrash.WebProxy = new WebProxy("Web proxy address"),

Send reports to your DrDump account

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.

Capture whole screen instead of application screen

You can take screenshot of whole screen instead of only application when application crashes by adding following line in SendReport method.

reportCrash.CaptureScreen = true;

Use SMTP to send crash reports directly to email

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"
};
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].