The type or namespace MongoServer could not be found The type or namespace MongoServer could not be found mongodb mongodb

The type or namespace MongoServer could not be found


I learned through the MSDN Forums that I need to use the MongoDb.Driver.Legacy version, which can be installed through the Nuget Management Console with this command:

Install-Package mongocsharpdriver

The project now builds without error.


This is because you have installed an older version.Please go to Nuget Package console manager and reinstall the Mongocsharp Driver.

Install-Package mongocsharpdriver

After installing build the solution.