serilog / serilog-sinks-periodicbatching

Infrastructure for Serilog sinks that process events in batches.
Apache License 2.0
73 stars 29 forks source link

.NET 6 conflicting versions of System.Threading.Channels #80

Closed mprice-gcmlp closed 6 months ago

mprice-gcmlp commented 6 months ago

Running into a strange issue in a .NET 6 Azure Function project. This package specifies System.Threading.Channels 8.0.0 which conflicts with the 6.0 version included in the .NET 6 SDK and results in a weird error

Could not load file or assembly 'System.Threading.Channels, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

Even though the DLL is quite clearly in the output folder etc. If you downgrade to the matching version number to the framework you are using, it appears to resolve the issue.

The docs kind of mention this saying "However, if you're using .NET Core 3.0 or later, the package is included as part of the framework."

Oddly, this doesn't appear to be a problem for a different project I have that is a .NET 6 web app instead of a function app. Not sure why it figures itself out for one but not the other.

Not working AzureFunction

Working NET 6 Web App