Thanks for sharing!
The error MongoDB.Driver.MongoIncompatibleDriverException occurs because the MongoDB C# driver version currently installed in your application is not compatible with your MongoDB server version.
Here are some steps which are helpful
- Open your MongoDB shell or Compass and run db.version(), note the server version shown.
- Open the project in Visual Studio or your code editor).
- Open Package Manager Console (or use terminal).
- Update the MongoDB C# driver to a version that matches your server. Use one of these commands:
Visual Studio : Update the package MongoDB.Driver -Version 2.14.1
.NET CLI (terminal): dotnet add package MongoDB.Driver -version 2.14.1
- In the project: Clean the solution, then Rebuild the solution.
- Restart the application.
- Test the connection again.