serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
283 stars 148 forks source link

Detected package downgrade of System.Configuration.ConfigurationManager with version 6.7.0 #552

Closed binick closed 2 months ago

binick commented 3 months ago

After update to version 6.7.0 I'm having this problem:

error NU1605:
      Warning As Error: Detected package downgrade: System.Configuration.ConfigurationManager from 8.0.0 to 6.0.1. Reference the package directly from the project to select a different version.
       My.Project -> Serilog.Sinks.MSSqlServer 6.7.0 -> Microsoft.Data.SqlClient 5.2.1 -> System.Configuration.ConfigurationManager (>= 8.0.0)
       My.Project -> Serilog.Sinks.MSSqlServer 6.7.0 -> System.Configuration.ConfigurationManager (>= 6.0.1)

This is caused by the fact that version 5.2.1 of Microsoft.Data.SqlClient uses at least version 8.0.0 of System.Configuration.ConfigurationManager when compiled with the .NET 8 target framework while the Serilog.Sinks.MSSqlServer package continues to use an older mejor version.

Serilog packages used in the project:

Target framework and operating system:

Pitxi commented 3 months ago

Same problem here.

To solve it, i installed the package Microsoft.Data.SqlClient 5.2.1 Explicitly from nuget, then installed Serilog.Sinks.MSSqlServer package.

neozhu commented 3 months ago

me too

johenvalera commented 2 months ago

me too

ckadluba commented 2 months ago

Downgraded SqlClient to 5.1.6 and created a dev release with the changes. This should fix the described package downgrade issue.

https://www.nuget.org/packages/Serilog.Sinks.MSSqlServer/6.7.1-dev-00084

Please try it out and give us some feedback. Thanks a lot! :)

lucasNewSharp commented 2 months ago

I'm having a similar problem with the latest update. Some of my packages use the System.Configuration.ConfigurationManager 7.0.0 transitive package and when I upgrade to version 6.7.0 the configuration loading stops because it requires System.Configuration.ConfigurationManager from 8.0.0. So for now I'm going to downgrade Sink and wait, maybe I'll be stuck with this version of Sink (6.6.1) for a while until all my dependencies update the ConfigurationManager. I don't feel comfortable manually updating Transitive packages, there are always risks.

ckadluba commented 2 months ago

@lucasNewSharp so you still see the package downgrade issue with the dev release 6.7.1-dev-00084 of the SQL sink, is that correct?

ckadluba commented 2 months ago

I tested today with a .NET 8 project and the sink code of 6.7.1-dev-00084 and the downgrade warning was gone. Will create a stable sink version 6.7.1 and close this issue.

lucasNewSharp commented 2 months ago

I tested today with a .NET 8 project and the sink code of 6.7.1-dev-00084 and the downgrade warning was gone. Will create a stable sink version 6.7.1 and close this issue.

I tested it now and this new version is working, thank you.

ckadluba commented 2 months ago

Thank you! ☺️