Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

424
Visualizações
.NET on OSX (Mono): can't connect to MongoDB

I'm developing a restful service with Visual Studio for Mac. In order to connect to my local MongoDB instance (which is up and running), I installed the MongoDB NuGet package. Classes are referenced correctly into code, however once I try to perform a connection it responds with the following error:

{
  "Message": "An error has occurred.",
  "ExceptionMessage": "An error occurred when trying to create a controller of type 'BalanzaController'. Make sure that the controller has a parameterless public constructor.",
  "ExceptionType": "System.InvalidOperationException",
  "StackTrace": "  at System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create (System.Net.Http.HttpRequestMessage request, System.Web.Http.Controllers.HttpControllerDescriptor controllerDescriptor, System.Type controllerType) [0x000f3] in <f99f496cb0d249c1a945c1fcabce1695>:0 \n  at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController (System.Net.Http.HttpRequestMessage request) [0x00028] in <f99f496cb0d249c1a945c1fcabce1695>:0 \n  at System.Web.Http.Dispatcher.HttpControllerDispatcher+<SendAsync>d__1.MoveNext () [0x000a9] in <f99f496cb0d249c1a945c1fcabce1695>:0 ",
  "InnerException": {
      "Message": "An error has occurred.",
      "ExceptionMessage": "ntdll.dll",
      "ExceptionType": "System.DllNotFoundException",
      "StackTrace": "  at (wrapper managed-to-native) Interop+NtDll:RtlGetVersion (Interop/NtDll/RTL_OSVERSIONINFOEX&)\n  at Interop+NtDll.RtlGetVersion () [0x0001a] in <f13660f89d0d419fba4e315693dd26ea>:0 \n  at System.Runtime.InteropServices.RuntimeInformation.get_OSDescription () [0x00007] in <f13660f89d0d419fba4e315693dd26ea>:0 \n  at MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateOSDocument () [0x00042] in <2c531fdd26874b5eb450bd126d409101>:0 \n  at System.Lazy`1[T].CreateValue () [0x00075] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/Lazy.cs:437 "
  }
}

It somehow fails at locating the correct dll file (or its correspondent in the Mono environment).

How can I fix it?

Thanks

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I got the exact same exception on Raspberry PI 3 (ARMV7) using Mono JIT compiler version 4.6.2. Downgrading the MongoDB C# drivers from 2.4.X to 2.3.0 solved the problem for me.

There is also an open issue here: https://jira.mongodb.org/browse/CSHARP-1875

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda