Update Sentry.NLog to use NLog 5
See original GitHub issuePackage
Sentry.Nlog
.NET Flavor
.NET
.NET Version
4.7.2
OS
Windows
SDK Version
3.17.1
Self-Hosted Sentry Version
No response
Steps to Reproduce
Use the NLog 5 nuget package.
Expected Result
No errors
Actual Result
System.TypeInitializationException
HResult=0x80131534
Message=De type-initialisatiefunctie voor automate.logging.NLogLogger heeft een uitzondering veroorzaakt.
Source=automate.logging
StackTrace:
at automate.logging.NLogLogger.Fatal(Exception x, Boolean LogExtern) in D:\sources\automate\automate.logging\NLogLogger.cs:line 214
at automate.App.ApplicationStartup(Object sender, StartupEventArgs e) in D:\sources\automate\automate\App.xaml.cs:line 1074
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
This exception was originally thrown at this call stack:
[External Code]
automate.logging.NLogLogger.ConfigureLogger() in NLogLogger.cs
automate.logging.NLogLogger.NLogLogger() in NLogLogger.cs
Inner Exception 1:
FileLoadException: Kan bestand of assembly NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c of een van de afhankelijkheden hiervan niet laden. De manifestdefinitie van de gevonden assembly komt niet overeen met de assembly-verwijzing. (Uitzondering van HRESULT: 0x80131040)
Issue Analytics
- State:
- Created a year ago
- Comments:11 (9 by maintainers)
Top Results From Across the Web
NLog | Sentry Documentation
Sentry provides an integration with NLog through the Sentry.NLog NuGet package . Installation. Add the Sentry dependency: Package Manager
Read more >How to connect Sentry to NLog in a .Net 5 project
I'm trying to connect Sentry to NLog. I'd like to write the logs with a level under Warning in a file text and...
Read more >Sentry.NLog 3.35.0
Official NLog integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.
Read more >Sentry.NLog 2.1.5-beta
Official NLog integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time.
Read more >Config options for NLog's configuration
Config options for NLog's configuration read more... The following types can be configured: ... Database - Writes log messages to the database using...
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 agree, however that will be a breaking change, so we can do that in the next major release. I’ll mark this as an enhancement to the 4.0.0 milestone.
@mrfatmen - For now, here is the binding redirect to add to your
App.config
file:FYI, if you are using Visual Studio’s Nuget GUI and add
NLog
5 and thenSentry.NLog
, it will add this redirect automatically.Hey @simonmolino, it still might be a little while for the update to land. I’m not sure I understand your setup: You’re building a DLL that has Sentry as a dependency, and when that library gets loaded by Excel you encounter the
TypeInitializationException
? Could you provide us with a minimal repro?