ChilliCream/graphql-platform

HotChocolate.Data.MongoDb not compatible with MongoDB.Driver >= 2.28.0

Closed this issue · 3 comments

Product

Hot Chocolate

Version

13.9.14

Link to minimal reproduction

https://github.com/erikkipp/hc-mongodb-issue

Steps to reproduce

Building the solution will cause Error CS0012 : 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'. Downgrade to MongoDB.Driver 2.27.0 from the current version 2.29.0. Build the solution again, should succeed. Something changed in MongoDB.Driver 2.28.0 that is causing this issue.

What is expected?

I should be able to have a reference to an external library that has a reference to MongoDB.Driver and build without error CS0012.

What is actually happening?

Build Error CS0012 : 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'

Relevant log output

1>ActionQueries.cs(15,16): Error CS0012 : 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'.
1>ActionQueries.cs(15,16): Error CS0012 : The type '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'.
1>ActionQueries.cs(15,16): Error CS0012 : 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'.

Additional context

No response

There have been multiple breaking changes in MongoDB.Driver (here & here).

Hot Chocolate v14 supports 2.28.0 and 2.29.0.

We have upgrade Hot Chocolate 14 so you will need to upgrade.

thanks guys