Mongo安全漏洞的错误需要升级,方法如下
命令行执行:
dotnet new classlib –framework “netstandard2.0” -o MongoDBUnity
cd MongoDBUnity
dotnet add package MongoDB.Driver
dotnet publish
将新建的类库项目路径\MongoDBUnity\bin\Debug\netstandard2.0\publish
内的所有文件复制到Unity的Plugins/MongoDB文件夹下.
升级mongodb,需要添加ET命名空间的类到信任列表才能序列化成功,在Share/init.cs和MongoHelper.cs里头添加注册:var objectSerializer = new ObjectSerializer(type => ObjectSerializer.DefaultAllowedTypes(type) || type.FullName.StartsWith(“ET”)); BsonSerializer.RegisterSerializer(objectSerializer);

