Xabaril / AspNetCore.Diagnostics.HealthChecks

Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Apache License 2.0
4.11k stars 801 forks source link

Compatibility issue with MongoDB.Driver v2.28.0 #2265

Closed edervisis closed 3 months ago

edervisis commented 4 months ago

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

Additional Context

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

benjaminoerskov commented 4 months ago

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 commented 4 months ago

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 commented 2 months ago

@unaizorrilla is there any chance we could ship 8.1.0 of Mongo package? It would help us to unblock Aspire with https://github.com/dotnet/aspire/issues/5427

unaizorrilla commented 2 months ago

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 commented 2 months ago

Hi @adamsitnik @Alirexaa and @benjaminoerskov @ThomasTosik

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

adamsitnik commented 2 months ago

@unaizorrilla thank you very much!

Ghostbird commented 3 weeks ago

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.