i3arnon / MongoAsyncEnumerableAdapter

Provides an adapter from MongoDB's IAsyncCursor & IAsyncCursorSource to IAsyncEnumerable
MIT License
20 stars 5 forks source link

Mongo Driver 2.28 Strong Naming change prevents using this package #6

Open mikebarber1 opened 2 months ago

mikebarber1 commented 2 months ago

https://www.mongodb.com/community/forums/t/net-c-driver-strong-naming/291649

With "MongoDB.Driver" Version="2.28.0" and the example code below compiling yields error message

Error CS0012 : The type 'IMongoQueryable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'MongoDB.Driver, Version=2.14.1.0, Culture=neutral, PublicKeyToken=null'.

Downgrading to 2.27 (that does not have Strong Naming) builds successfully.

` var collection = Client.GetDatabase(DatabaseName).GetCollection(CollectionName); var fdb = new FilterDefinitionBuilder();

var fd = fdb.Where(expression); var cursor = await collection.FindAsync(fd, cancellationToken: ct).ConfigureAwait(false);

return cursor.ToAsyncEnumerable(); `

i3arnon commented 2 months ago

That's very surprising, but it seems you're correct. Thanks for letting me know.

I guess I'll need to publish a strong-named version. I can't gurrantee this will be timely.