Skip to content

Commit

Permalink
Dependency Update, Replaced DrDump with Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterStrick committed Apr 30, 2024
1 parent fd9bb76 commit c069450
Show file tree
Hide file tree
Showing 37 changed files with 734 additions and 409 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ FodyWeavers.xsd
/lib/RCWF/*/*.*.*.XML
/lib/RCWF/*/*.*.*.Designer.*

# Crash Reporter GUID
/vivetool-gui/Functions/CrashReporter.GUID.vb
/ViVeTool-GUI.FeatureScanner/Functions/CrashReporter.GUID.vb
# Sentry
/vivetool-gui/Functions/SentryHandler.DSN.vb
/ViVeTool-GUI.FeatureScanner/Functions/SentryHandler.DSN.vb

# Environment Files
**/*.env
Expand Down
20 changes: 20 additions & 0 deletions ViVeTool-GUI.FeatureScanner/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
33 changes: 31 additions & 2 deletions ViVeTool-GUI.FeatureScanner/ApplicationEvents.vb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,26 @@
'
'You should have received a copy of the GNU General Public License
'along with this program. If not, see <https://www.gnu.org/licenses/>.
Imports System.Configuration, System.Globalization, Telerik.WinControls.UI
Imports System.Configuration, System.Globalization, Microsoft.VisualBasic.ApplicationServices

Namespace My
''' <summary>
''' .Net Framework Application Framework
''' </summary>
Partial Friend Class MyApplication
Private Sub MyApplication_Startup(sender As Object, e As ApplicationServices.StartupEventArgs) Handles Me.Startup
''' <summary>
''' Used to set the Application Theme, Language and Settings, check for missing Assemblies and initialize Sentry
''' </summary>
''' <param name="sender">Default sender Object</param>
''' <param name="e">Default EventArgs</param>
Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup
' Check for Assembly Reference Version differences, used to compat Crashes if a Reference has been replaced by another Version,
' without updating the Reference in Visual Studio. (For example replacing the DLL File)
CheckAssemblyVersion()

' Initialize Sentry
SentryHandler.Init()

' Set Language
If Settings.TwoCharLanguageCode IsNot "" Then
CultureInfo.DefaultThreadCurrentCulture = New CultureInfo(Settings.TwoCharLanguageCode)
Expand Down Expand Up @@ -91,5 +102,23 @@ Namespace My
End If
End If
End Sub

''' <summary>
''' Used to show the Sentry Exception Dialog
''' </summary>
''' <param name="sender">Default sender Object</param>
''' <param name="e">Unhandled Exception EventArgs</param>
Private Sub MyApplication_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs) Handles Me.UnhandledException
SentryHandler.ShowSentry(e.Exception)
End Sub

''' <summary>
''' Used to Dispose of the Sentry SDK to ensure events are flushed and sent to Sentry
''' </summary>
''' <param name="sender">Default sender Object</param>
''' <param name="e">Default EventArgs</param>
Private Sub MyApplication_Shutdown(sender As Object, e As EventArgs) Handles Me.Shutdown
SentryHandler.Dispose()
End Sub
End Class
End Namespace
85 changes: 0 additions & 85 deletions ViVeTool-GUI.FeatureScanner/C_Please_Change_CrashReporter.vb.md

This file was deleted.

29 changes: 29 additions & 0 deletions ViVeTool-GUI.FeatureScanner/C_Please_Change_SentryHandler.vb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Please change SentryHandler.vb yourself.

I do not wish to scramble my brain trying to figure out where ViVeTool GUI is crashing, before figuring out that that Crash Report came from a Git Clone or Fork.

## You can change the SendSentry() Sub of SentryHandler.vb if you want to add Custom Sentry Scopes:

Custom Scopes are used to Display User-configured settings within My.Settings, you can add your own using the following Template:

```vbnet
SentrySdk.ConfigureScope(
Sub(Scope)
Scope.Contexts("My Custom Category") = New With {
.MyCustomSetting = "My Custom Value",
...
}
End Sub)
```

## Change the Sentry DSN within SentryHandler.DSN.vb

Pretty more or less self-explanatory. Create your own Sentry Account either on https://sentry.io or Self-hosted, create a Project and get it's DSN Link

```vbnet
Private Shared ReadOnly _DSN As String = "YOUR DSN HERE"
```

## Other Things to Note:

Refer to the [Sentry.NET Documentation](https://docs.sentry.io/platforms/dotnet/) for further Details, Functions, Methods and Properties that the Sentry SDK provides
6 changes: 3 additions & 3 deletions ViVeTool-GUI.FeatureScanner/Functions/AssemblyVersionCheck.vb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Imports System.Reflection
''' </summary>
Module AssemblyVersion
''' <summary>
''' Sub that Checks the CrashReporter.NET and Telerik DLLs for Version differences
''' Sub that Checks the Sentry and Telerik DLLs for Version differences
''' </summary>
Public Sub CheckAssemblyVersion()
For Each Reference In Assembly.GetExecutingAssembly().GetReferencedAssemblies()
Select Case Reference.Name
Case "CrashReporter.NET"
Check(Application.StartupPath & "\CrashReporter.NET.dll", Reference.Version.ToString)
Case "Sentry"
Check(Application.StartupPath & "\Sentry.dll", Reference.Version.ToString)
Case "Telerik.WinControls"
Check(Application.StartupPath & "\Telerik.WinControls.dll", Reference.Version.ToString)
Case "Telerik.WinControls.RadToastNotification"
Expand Down
60 changes: 0 additions & 60 deletions ViVeTool-GUI.FeatureScanner/Functions/CrashReporter.vb

This file was deleted.

Loading

0 comments on commit c069450

Please sign in to comment.