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

Compatibility issue with MongoDB.Driver v2.28.0 #2265

Closed
edervisis opened this issue Jul 24, 2024 · 7 comments · Fixed by #2266
Closed

Compatibility issue with MongoDB.Driver v2.28.0 #2265

edervisis opened this issue Jul 24, 2024 · 7 comments · Fixed by #2266
Assignees

Comments

@edervisis
Copy link

Description

I am experiencing a compatibility issue with the AspNetCore.HealthChecks.MongoDB package and the latest version of MongoDB.Driver (v2.28.0). The health check expects MongoDB.Driver v2.22.0 and I encounter the following error when attempting to build the project:

Severity Code Description Project File Line Suppression State
Error (active) CS0012 The type 'MongoClientSettings' is defined in an assembly that is not referenced. You must add a reference to assembly 'MongoDB.Driver, Version=2.22.0.0, Culture=neutral, PublicKeyToken=null'.
Error (active)	CS0012	The type 'IMongoClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'MongoDB.Driver, Version=2.22.0.0, Culture=neutral, PublicKeyToken=null'.

Steps to Reproduce

  1. Reference the latest version of MongoDB.Driver (v2.28.0) in the project.
  2. Add AspNetCore.HealthChecks.MongoDB to the project.
  3. Attempt to build the project.

Expected Behavior

The project should be built successfully without version conflicts.

Actual Behavior

The build fails with the following error message:
Error (active) CS0012 The type 'MongoClientSettings' is defined in an assembly that is not referenced. You must add a reference to assembly 'MongoDB.Driver, Version=2.22.0.0, Culture=neutral, PublicKeyToken=null'. Severity Code Description Project File Line Suppression State Error (active) CS0012 The type 'IMongoClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'MongoDB.Driver, Version=2.22.0.0, Culture=neutral, PublicKeyToken=null'.

Environment

  • AspNetCore.HealthChecks.MongoDB version: [v8.0.1]
  • MongoDB.Driver version: 2.28.0
  • net8.0
  • Operating System: [Windows]

Additional Context

Any guidance on resolving this compatibility issue or an update to support the latest MongoDB.Driver would be greatly appreciated.

@benjaminoerskov
Copy link

We are also experiencing this and it's stopping us from upgrading packages with the new MongoDb.Driver v2.28.0. Worked fine with v2.27.0.

@ThomasTosik
Copy link

Other packages that we reference in our projects that indirectly have MongoDb.Driver reference also have this issue. So i would assume its the MongoDb.Driver. They cleaned some stuff in this version and reinroduced Strong-Named Assemblies. Maybe thats the problem.

@adamsitnik
Copy link
Collaborator

@unaizorrilla is there any chance we could ship 8.1.0 of Mongo package? It would help us to unblock Aspire with dotnet/aspire#5427

@unaizorrilla
Copy link
Collaborator

unaizorrilla commented Aug 28, 2024

Hi @adamsitnik

Ok, I'm update the package version and thow the release in a few minutes

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/actions/runs/10601958448

unaizorrilla added a commit that referenced this issue Aug 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@unaizorrilla
Copy link
Collaborator

Hi @adamsitnik @Alirexaa and @benjaminoerskov @ThomasTosik

Package published on nuget with version 8.1.0, this will be listed in a few minutes!

@adamsitnik
Copy link
Collaborator

@unaizorrilla thank you very much!

@Ghostbird
Copy link

Ghostbird commented Oct 31, 2024

The fundamental issue was not resolved. So if like us, you're using e.g. MongoDb.Driver 3+, you get this same issue, but now it can't find MongoDb.Driver.Core 2.28. I assume it'll break every time we update MongoDB.Driver.

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

Successfully merging a pull request may close this issue.

7 participants