I am trying to get the C# NuGet driver to work with Unity.
So I used NuGet (for Unity) to load and install the driver.
There are two issues with the package:
the package MongoDB.Libmongocrypt.1.6.0 contains a number older versions of the library
under a subfolder “…content files/any”. Since those folders contain files with the same name Unity complains about the file names not being unique. This can be mended by just deleting that folder.
It is anoying however and left me wondering and researching some time as to which I should use and whether I could just delete the ones I don’t need. Maybe you could make a package without the other versions.
the package also depends on Snappier 1.0.0.
For this Unity logs this error:
“Assembly ‘Assets/Packages/Snappier.1.0.0/lib/netstandard2.1/Snappier.dll’ will not be loaded due to errors:
Snappier references strong named System.Runtime.CompilerServices.Unsafe Assembly references: 184.108.40.206 Found in project: 220.127.116.11.
Assembly Version Validation can be disabled in Player Settings “Assembly Version Validation””
So there seems to be a mismatch in versions and I don’t know how to remedy that. I definitely do not want to deactivate version validation!
Any help would be deeply appreciated!
many thx fr your reply. Good to know that other people are facing similar problems (is it just me or…).
I am working under Win10 though using Unity 2021.3.16f1 (LTS)
After finding some feedback on Stackoverflow I managed to pull this off (similar to your approach):
Download the current NuGet MongoDb driver
Copy all .net Standard 2.0 version of the DLLs into a Plugin folder in my Unity project.
It seems to be working but now Unity is crashing quite often so I am not all that content yet. I will have to investigate the cause from the logs - will report if anything seems connected to the driver.