Since the past year, we have updated regularly the MongoDB C# driver from version 2.20 up to 2.27.
All updates had no issues.
More recently, when trying to update the NuGet package from version 2.27 to 2.28, the solution does not build with the several errors.
Examples:
The type ‘IMongoCollection<>’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘MongoDB.Driver, Version=2.19.1.0, Culture=neutral, PublicKeyToken=null’
The type ‘IFindFluent<,>’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘MongoDB.Driver, Version=2.19.1.0, Culture=neutral, PublicKeyToken=null’
‘IAggregateFluent<>’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘MongoDB.Driver, Version=2.19.1.0, Culture=neutral, PublicKeyToken=null’
If we revert back to version 2.27 the solution builds fine.
I have noticed the same issue today when upgraded to 2.28. I am using AspNetCore.HealthChecks.MongoDb package which was updated with mongo db v2.28 5 days ago.
Hi, I’m also experiencing this issue with one of our dependencies. We’re using HotChocolate for graphql. Since updating to 2.28 we can no longer reference the dependency.
I have tried to fork the repository. But it seems that HotChocolate itself has a dependency that also needs MongoDb to be bumped. I forked the repo and opened a PR for it.
I was expecting to see more discussion about this online. It seems like this should have been marked as a breaking change.
Thank you for bringing this to our attention, we just posted more details about this here. Sorry for the inconvenience caused but please feel free to reach out if you are blocked.
It seems we will be stuck on version 2.27.0 and we’ll definitely not fork third party libs.
It’s a shame that this was not flagged as a breaking change and the major version wasn’t bumped.
I was getting this with HotChocolate and solved by upgrading the following libs via nuget to pre-release ‘14.0.0-rc.1’
HotChocolate.AspNetCore
HotChocolate.Data.MongoDb
Underlying issue is 3rd party (HC) usage of MongoDb assemblies, i.e. v2.28 strong naming.