C Sharp Driver in Unity

We manage to get working :tada:

The trick was using a dotnet classlibrary project targeting .Net Standard 2.0:
> dotnet new classlib --framework "netstandard2.0" -o MongoDBUnity
> cd MongoDBUnity
> dotnet add package MongoDB.Driver
> dotnet publish

This will collect all the required dependencies:

Add this to the Unity project and it worked.

Note: This is only for the mono backend. We did not test it with IL2CCP (and I doubt that would work).

2 Likes