Skip to content
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

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

Closed
binick opened this issue Aug 20, 2024 · 9 comments

Comments

@binick
Copy link

binick commented Aug 20, 2024

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:

  • Serilog.AspNetCore: 8.0.2
  • Serilog.Settings.Configuration: 8.0.2
  • Serilog.Sinks.MSSqlServer: 6.7.0

Target framework and operating system:

  • .NET 8
    OS: Microsoft Windows 11 Pro - Version 10.0.22631 Build 22631
@Pitxi
Copy link

Pitxi commented Aug 20, 2024

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
Copy link

neozhu commented Aug 23, 2024

me too

1 similar comment
@johenvalera
Copy link

me too

ckadluba added a commit to ckadluba/serilog-sinks-mssqlserver that referenced this issue Aug 28, 2024
* Rather have 5.1 than 5.2 because 5.1 is LTS
* Fixes issue serilog-mssql#544 (partly) and issue serilog-mssql#552
@ckadluba
Copy link
Member

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
Copy link

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
Copy link
Member

@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
Copy link
Member

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
Copy link

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
Copy link
Member

Thank you! ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants