-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] MongoDB driver dependency mismatch with MongoDB.Driver 3.0 #2475
Comments
Hi, @mribeiro-clearsale. Our dependency targets the minimum supported version. I've tried to reproduce on our test project by updating that to target 2.30, and I see no compilation errors, even when the |
Hi, Steve. Thanks for the feedback. Actually, the problem occurs because in my application I reference the dependency Elastic.Apm.NetCoreAll which has a dependency on MongoDB.Driver.Core 2.29.0 through the dependency Elastic.Apm.MongoDb. In my application, I am trying to update the dependency of MongoDB.Driver to 2.30. When I do this, an error occurs due to two different versions of the same dependency, making it impossible for me to update the driver version to 2.30. Also, we use MongoDbEventSubscriber to trace MongoDB events, but an incompatibility error occurs with the IEventSubscriber interface from MongoDB.Driver 3.0. |
@mribeiro-clearsale I don't believe our Using a new .NET 8 project: csproj
Program.cs
We require a minimal repro to assist further. |
@stevejgordon thanks again for your reply. I just created the repo that reproduces the problem: https://github.com/mribeiro-clearsale/ElasticAPMMongoDBDependency/tree/master What I found strange is that in your print the NetCoreAll dependency is with version 1.30 of MongoDB.Driver.Core. But I just updated the NetCoreAll lib to 1.30.1 and the dependency remained at 1.28 as you can see in this repo |
I managed to solve the problem and I have no clue what happens. We were using version 2.28 and updated via Managed Nuget Packaged for Solutions. The csproj changed correctly to 2.30, but the dependencies of other packages that also depend on the driver did not change. Even after performing a cleanup on the solution, the problem persists. I changed the version manually in the csproj, going back to 2.28 and then back to 2.30 and it worked magically, the dependencies of all the libs were changed correctly, solving the problem. Thank you for your attention @stevejgordon |
You're welcome, @mribeiro-clearsale. I'm glad you managed to resolve it. |
I'm having a similar issue when trying to update my MongoDB.Driver to v3 and use the MongoDbEventSubscriber. I get: |
APM Agent version
Elastic.Apm.NetCoreAll 1.30.0
Environment
Operating system and version:
.NET 8
Describe the bug
We have been updating our MongoDB.Driver since we upgraded our MongoDB Cluster to 8.0 and we have new features that are only compatible with Driver 3.0.
This new driver version has some breaking changes:
MongoDB Driver 4.0 Breaking Changes
We are having issues with Elastic APM Agent because the MongoDB.Driver used is version 2.28
The error below occurs because we have MongoDB.Driver updated to 2.30 but Elastic.APM.NetCoreAll uses 2.28
And this error occurs because one of the breaking changes to MongoDB.Driver
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Upgrade MongoDB.Driver dependency on Elastic.APM.NetCoreAll
The text was updated successfully, but these errors were encountered: