I recently updated my Unity 2018 to the 2020 version then I created a new project to connect my game to a MongoDB database.

My main goal is to be able to store not only common data in my collection but also files and images by using GridFS.

I use Visual Studio 2019 Community so for my project. I installed the MongoDB drivers directly from NuGet. In Visual Studio everything is OK, I added a using for all required libraries and I have no errors but when I switch to Unity 2020 it seems that I can't start my project because my MongoDB driver is not correctly loaded there.

I found some tutorials like this one where they had the same problem and fixing it by adding the DLLs directly in the Unity folders. That works for me, but only with the DLLs shared in the tutorial (you can access the working DLLs in the video description).

What is a bit disturbing is that the DLLs' versions seem to be outdated, since the connections process is a bit different from the one in the MongoDB documentation.

I cloned the latest MongoDB C# driver repository from GitHub and tried to reproduce the same process with the latest DLLs, but once again it only works in VS 2019 but not in Unity, even though I have added the DLLs in the Unity folder.

Is there is some kind of compatibility problem between Unity and the latest MongoDB? How can I fix this to work with the latest version?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.