serilog / serilog-extensions-logging

Serilog provider for Microsoft.Extensions.Logging
Apache License 2.0
307 stars 97 forks source link

Serilog.Extensions.Logging 7.0.0 has a .NET 6.0 TFM with dependencies on 7.0 #226

Closed vanbukin closed 9 months ago

vanbukin commented 11 months ago

The Serilog.Extensions.Logging assembly, for all TFM, has the following dependencies:

Microsoft.Extensions.Logging 7.0.0 was released alongside ASP.NET Core 7 and .NET 7. However, ASP.NET Core 6 and .NET 6 are LTS versions that will receive updates until November 12, 2024, including package versions in the form of 6.0.x.

It would be great to have the ability to use Serilog.Extensions.Logging with .NET 6.0, where the minimum target version dependency could be Microsoft.Extensions.Logging (>= 6.0.0) instead of 7.0.0

nblumhardt commented 11 months ago

Thanks for the note. This is a bit of an unfortunate point-in-time consequence of the package versioning policy. When .NET 8 is released, v8 of this package will be released and will target 8.x dependency versions, so the problem you're observing won't occur.

.NET 6 was unfortunately a bit earlier than we made the versioning logic change. The previous major version of the package, however, (now at 3.1.0) is functionally equivalent and has the dependency structure you're after.

slaneyrw commented 9 months ago

Waiting for .NET 8 is well and good, but this problem with 7.x dependencies in .NET 6.0 is not isolated to this library... it's across the entire serilog landscape.

Have you published a document listing the appropriate versions of Serilog, Serilog.Extensions.*, Serilog.Sinks.*, etc to avoid a forced upgrade to 7.0.x. There are other 3rd party libraries that have specific dependencies on v 6.0.x and will break if v 7.0.x is brought in.

nblumhardt commented 9 months ago

@slaneyrw

The previous major version of the package, however, (now at 3.1.0) is functionally equivalent and has the dependency structure you're after.

should be as much info as you need to avoid this issue currently.

In future the rule will be - if you're targeting vX of Microsoft.Extensions. packages, use the matching vX Serilog.Extensions. packages.

HTH, Nick