SentrySDK v3 not working in VB .NET
See original GitHub issuePlease mark the type framework used:
- ASP.NET MVC
- ASP.NET Web API (OWIN)
- ASP.NET Core
- WPF
- WinForms
- Xamarin
- Other:
Please mark the type of the runtime used:
- .NET Framework
- Mono
- .NET Core
- Version: 4.8
Please mark the NuGet packages used:
- Sentry
- Sentry.Serilog
- Sentry.NLog
- Sentry.Log4Net
- Sentry.Extensions.Logging
- Sentry.AspNetCore
- Version: 2.1.8 & 3.7
I’m currently initializing SentrSDK 2.1.8 in VB .NET the following way:
Imports Sentry
Module mod_Main
Sub Main()
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
FrmSplash = New SplashScreen
FrmSplash.Show()
FrmSplash.Refresh()
SentrySdk.Init("https://1111111@o22222.ingest.sentry.io/333333")
frm_Main_Instance = New frm_Main
Application.Run(frm_Main_Instance)
End Sub
End Module
When I upgrade to SentrySDK 3.7, exceptions are not sent to Sentry.IO. I use the following test code:
Try
Throw New System.Exception("Testing.")
Catch ex As Exception
SentrySdk.CaptureException(ex)
End Try
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Troubleshooting for .NET
Learn more about how to troubleshoot common issues with the .NET SDK.
Read more >SentrySDK VB.NET initialization example
How do I convert the SentrySDK C# initialization code to VB.NET? using (SentrySdk.Init(o => { o.Dsn = "https://examplePublicKey@o0.ingest.sentry ...
Read more >Duplicate invocations of Sentry SDK initialization conflict ...
NET 5 and Sentry SDK version 3.0.6 ... The following code DOES NOT work: ... EF Core uses ILogger like any other part...
Read more >sentry-dotnet
Sentry SDK for .NET. Readme; Issues. Sentry. Bad software is everywhere, and we're tired of it. Sentry is on a mission to help...
Read more >Sentry 3.35.1
Official SDK for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I resolved the dependency issues using tips suggested here: https://stackoverflow.com/questions/42755274/visual-studio-2017-could-not-load-file-or-assembly-system-runtime-version-4
SentrySDK 3.8 now works correctly with VB.NET and the following initialization code:
Updated log:
Debug: Using ‘GzipBufferedRequestBodyHandler’ body compression strategy with level Optimal. Debug: Initializing Hub for Dsn: ‘https://1111@2222.ingest.sentry.io/3333’. Debug: Registering integration: ‘AutoSessionTrackingIntegration’. Debug: Registering integration: ‘AppDomainUnhandledExceptionIntegration’. Debug: Registering integration: ‘AppDomainProcessExitIntegration’. Debug: Registering integration: ‘TaskUnobservedTaskExceptionIntegration’. Debug: Registering integration: ‘NetFxInstallationsIntegration’. Debug: New scope pushed. Before SentrySdk.CaptureMessage Info: Capturing event. Debug: Running main event processor on: Event 620db433f3474b7bb9b1b0e7782d434d Debug: No Exception and AttachStacktrace is off. No stack trace will be collected. Debug: Envelope queued up. After SentrySdk.CaptureMessage Debug: Envelope 620db433f3474b7bb9b1b0e7782d434d handed off to transport. #1 in queue. Before SentrySdk.CaptureException Exception thrown: ‘System.Exception’ in DB_GUI.exe Debug: Failed to report an error on a session because there is none active. Info: Capturing event. Debug: Running processor on exception: Testing. Debug: Creating SentryStackTrace. isCurrentStackTrace: False. Debug: Running main event processor on: Event d52b366ec9af4b9cb06e57c8833ef2d0 Debug: Envelope queued up. After SentrySdk.CaptureException Debug: Envelope 620db433f3474b7bb9b1b0e7782d434d successfully received by Sentry. Debug: Envelope d52b366ec9af4b9cb06e57c8833ef2d0 handed off to transport. #1 in queue. Debug: Envelope d52b366ec9af4b9cb06e57c8833ef2d0 successfully received by Sentry. Debug: Using ‘GzipBufferedRequestBodyHandler’ body compression strategy with level Optimal. Debug: Initializing Hub for Dsn: ‘https://1111@2222.ingest.sentry.io/3333’. Debug: Registering integration: ‘AutoSessionTrackingIntegration’. Debug: Registering integration: ‘AppDomainUnhandledExceptionIntegration’. Debug: Registering integration: ‘AppDomainProcessExitIntegration’. Debug: Registering integration: ‘TaskUnobservedTaskExceptionIntegration’. Debug: Registering integration: ‘NetFxInstallationsIntegration’. Debug: New scope pushed. Before SentrySdk.CaptureMessage Info: Capturing event. Debug: Running main event processor on: Event 84374b4dbca54381b7dc25f3c0b341eb Debug: No Exception and AttachStacktrace is off. No stack trace will be collected. Debug: Envelope queued up. After SentrySdk.CaptureMessage Debug: Envelope 84374b4dbca54381b7dc25f3c0b341eb handed off to transport. #1 in queue. Before SentrySdk.CaptureException Exception thrown: ‘System.Exception’ in DB_GUI.exe Debug: Failed to report an error on a session because there is none active. Info: Capturing event. Debug: Running processor on exception: Testing. Debug: Creating SentryStackTrace. isCurrentStackTrace: False. Debug: Running main event processor on: Event 9f02d0fcb380423e825705da8bc1f436 Debug: Envelope queued up. After SentrySdk.CaptureException Debug: Envelope 84374b4dbca54381b7dc25f3c0b341eb successfully received by Sentry. Debug: Envelope 9f02d0fcb380423e825705da8bc1f436 handed off to transport. #1 in queue. Debug: Envelope 9f02d0fcb380423e825705da8bc1f436 successfully received by Sentry. Info: Disposing the Hub. Debug: Disposing SentryClient. Debug: Disposing BackgroundWorker. Debug: Shutdown scheduled. Stopping by: 00:00:02. #0 in queue. Info: Exiting the worker with an empty queue. Debug: Disposing scope. Debug: Disposing SentryScopeManager.
I changed the initialization code to the following using SDK 3.8:
The log seems more promising, but I have yet to find a way to resolve the dependency issue.