Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
Exception occurs when using MongoDB driver for DotNet Core

I'm working on solution on the following stack:

  • ASP.NET Core
  • .NET Core
  • MongoDB

...using this driver for communication with the database: https://www.nuget.org/packages/MongoDB.Driver.Core/ ...version 2.4.1

I'm trying to instantiate the MongoClient like this:

var options = provider.GetService<IOptions<MongoDbSettings>>();
var client = new MongoClient(options.Value.ConnectionString);

But the last statement errors out saying:

An exception of type 'System.MissingMethodException' occurred in MongoDB.Driver.dll but was not handled in user code

and

Additional information: Method not found: 'Void MongoDB.Driver.ReadPreference..ctor

I've noticed that the class MongoClient is in the MongoDB.Driver -namespace, not in MongoDB.Driver.Core. Does that mean it is not compatible with .Net Core? If so, how do I then connect to the database?

All help appreciated!

Regards, Jon

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I ended up using this driver: http://mongodb.github.io/mongo-csharp-driver/

version 2.3.0, which solved the problem.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda