WHile upgrading the ABP 7.3.2 to ABP 9.2.0, we are facing issue with Mongo, we have a code something like
But with the latest Mongo Driver (3.3.0) we are getting
---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Could not load file or assembly 'MongoDB.Bson, Version=3.4.0.0, Culture=neutral, PublicKeyToken=94992a530f44e321'. The system cannot find the file specified. Could not load type 'MongoDB.Driver.Linq.IMongoQueryable`1' from assembly 'MongoDB.Driver, Version=3.3.0.0, Culture=neutral, PublicKeyToken=94992a530f44e321'.
we cant change the logic in Mongo Repository as we have that many instances.
Can you please advise. as we dont want to change across multi servies and pages which have which is difficult to do
4 Answer(s)
-
0
To resolve issues after upgrading ABP from 7.3.2 to 9.2.0 with the new MongoDB driver (3.3.0+), you must update your code and dependencies according to the official migration guides:
Update all MongoDB-related NuGet packages to versions compatible with MongoDB.Driver 3.x. Ensure there are no old references to MongoDB.Bson or MongoDB.Driver from previous versions in your solution or bin/obj folders.
The error regarding
IMongoQueryable<>
and missing types is likely due to version mismatches or breaking changes in the MongoDB driver. The ABP 9.2 migration guide specifically notes the upgrade to MongoDB.Driver 3.x and provides a link to the official MongoDB migration guide for breaking changes.Review and update your code according to the MongoDB Driver 2.x to 3.x migration guide. Some APIs and namespaces have changed or been removed. You may need to update usages of
IMongoQueryable<>
and related LINQ queries to match the new driver’s API.Clean and rebuild your solution after removing all old MongoDB driver references.
For detailed steps and breaking changes, see:
These guides will help you identify and resolve all breaking changes related to the MongoDB driver upgrade.
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
Can you please advise. as we dont want to change across multi servies and pages which have which is difficult to do
-
0
Hello 👋,
We have upgraded the MongoDB Driver 2 to 3 in the new version, and we have prepared a migration guide for it. You can upgrade your application with minimal changes by following the migration guide.
Here is MongoDB driver 2 to 3 migration guide: https://abp.io/docs/latest/release-info/migration-guides/MongoDB-Driver-2-to-3
Unfortunately, there is nothing else we can suggest; this change is caused by MongoDB's driver.
-
0
did you solve your problem? and how?