Open igrebel opened 3 years ago
Are you using the binaries from NuGet or the raw code? What is the error you're receiving?
Hello,
can you show me a little VB.net example? I was trying to include your crashreporter, but have some errors.
Thanks!
I seem to have gotten CrashReporter.Net to work on VB.Net, see Code Example:
Hope it helps!
Imports System.Threading, CrashReporterDotNET
Public Class Form1
''' <summary>
''' Main entry point of the Program.
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'Listen to Application Crashes and show CrashReporter.Net if one occurrs.
AddHandler Application.ThreadException, AddressOf ApplicationThreadException
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf CurrentDomainOnUnhandledException
End Sub
''' <summary>
''' Show CrashReporter.Net for unhandled exceptions.
''' </summary>
''' <param name="sender"></param>
''' <param name="unhandledExceptionEventArgs"></param>
Private Shared Sub CurrentDomainOnUnhandledException(sender As Object, unhandledExceptionEventArgs As UnhandledExceptionEventArgs)
SendReport(DirectCast(unhandledExceptionEventArgs.ExceptionObject, Exception))
Environment.[Exit](0)
End Sub
''' <summary>
''' Show CrashReporter.Net for Application Thread Exceptions.
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Shared Sub ApplicationThreadException(sender As Object, e As ThreadExceptionEventArgs)
SendReport(e.Exception)
End Sub
''' <summary>
''' Main Sub that calls CrashReporter.Net to send an error report
''' Replace mail@example.com with your or another Email Address.
''' You can hide or show the screenshot Tab by setting ShowScreenshotTab to either True or False.
''' If you have a https://drdump.com account, you can set your Application GUID according to your Dr.Dump Application, if not remove the .DrDumpSettings section.
''' </summary>
''' <param name="exception"></param>
Public Shared Sub SendReport(exception As Exception)
Dim reportCrash = New ReportCrash("mail@example.com") With {
.ShowScreenshotTab = True,
.DoctorDumpSettings = New DoctorDumpSettings With {
.ApplicationID = New Guid("00000000-0000-0000-0000-000000000000")
}
}
reportCrash.Send(exception)
End Sub
''' <summary>
''' Your average Button or Code that is crashing. In this case it is a Button throwing an exception.
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Throw New ApplicationException("This is an error, as well as a Test for CrashReporter.Net")
End Sub
End Class
Hello,
can you show me a little VB.net example? I was trying to include your crashreporter, but have some errors.
Thanks!