我正在使用 Visual Studio .NET 4.6 和 Robomongo连接到我的数据库没有问题
我对 MongoDB 的导入
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Bson;
正在执行的代码:
MongoClient client = new MongoClient("mongodb://localhost");
MongoServer server = client.GetServer();
MongoDatabase mongoDatabase = server.GetDatabase("GameCollection");
完整的错误信息:
An unhandled exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
Additional information: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
最佳答案
安装缺少的软件包。使用 Package-installer,发出以下命令: 安装包 System.Runtime.InteropServices.RuntimeInformation
关于c# - MongoDB 客户端在 mscorlib 中引发 FileNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40368208/