ChilliCream / graphql-platform

Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
https://chillicream.com
MIT License
5.24k stars 744 forks source link

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

Closed erikkipp closed 4 weeks ago

erikkipp commented 4 weeks ago

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

glen-84 commented 4 weeks ago

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

Hot Chocolate v14 supports 2.28.0 and 2.29.0.

michaelstaib commented 4 weeks ago

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

erikkipp commented 4 weeks ago

thanks guys