-
-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Sentry.NLog to use NLog 5 #1667
Comments
@mrfatmen have you tried adding a binding redirect to v5 of nlog? |
Looks like NLog 5 was recently released and has lots of breaking changes. https://nlog-project.org/2022/05/16/nlog-5-0-finally-ready.html First item says: "Strong Version Changed" - so I don't believe a binding redirect is possible. We will have to investigate further. Thanks for bringing this to our attention. |
@mattjohnsonpint given binding redirects are a pain, I would prefer we updated to nlog 5 and did a release |
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 <?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> FYI, if you are using Visual Studio's Nuget GUI and add |
The callstack doesn't seem to include any Sentry-classes:
The pain of strong-version is only for .NET Framework-assemblies. All .NET Framework-assemblies must be compiled with the correct major-version-assemblies, which the application will be deployed with. I guess if Sentry-Library removed the now unsupported .NET Framework 4.61-target (and just relied on .NET Standard2), then Sentry-Library would never be to blame. It would be the job of the application-owner to ensure all their relevant .NET Framework-project referenced the correct major-version-assembly at build-time. |
This seems to work. Thank you. |
Glad to hear the binding redirect works. We'll keep this issue open though so that we remember to update NLog in a future release. Thanks. |
hi @mattjohnsonpint - is there any update on this issue? or possible upgrade/fix? We have a .net 4.8 framework dll that uses NLog v5 as well as referencing Sentry.NLog (using NLog v4). We have added the binding redirect as suggested however still encounter the System.TypeInitializationException exception. Our dll is being loaded by excel - as opposed to our own application. If no upgrade/fix is scheduled, any idea on a possible workaround? |
@simonmolino - I no longer work for Sentry, but I'm sure that @bruno-garcia can help you. Thanks. |
Hey @simonmolino, it still might be a little while for the update to land. |
We upgraded to |
Package
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
The text was updated successfully, but these errors were encountered: