Hello. I try to work with mongoDB in VS15, for this I downloaded MongoDB.Driver version 2.4.0. I also use GridFS. Also downloaded the latest version from Nuget.

using MongoDB.Driver; using MongoDB.Driver.GridFS; using System.Configuration; namespace _13.Models { public class ComputerContext { MongoClient client; IMongoDatabase database; MongoGridFS gridFS; public ComputerContext() { string connectionString = ConfigurationManager.ConnectionStrings["MongoDb"].ConnectionString; var con = new MongoUrlBuilder(connectionString); client = new MongoClient(connectionString); database = client.GetDatabase(con.DatabaseName); gridFS = new MongoGridFS( new MongoServer( new MongoServerSettings { Server = con.Server }), con.DatabaseName, new MongoGridFSSettings() ); } public IMongoCollection<Computer> Computers { get { return database.GetCollection<Computer>("Computers"); } } public MongoGridFS GridFS { get { return gridFS; } } } } 

But the problem is that the GridFS namespace is not connected and, accordingly, the compiler curses everything connected with it. I try to do by example from here. Description of work with GridFS

  • Hi, I encountered the same problem. Maybe you have already found a solution? - Mike111
  • 2
    Is the package nuget.org/packages/MongoDB.Driver.GridFS installed? - PashaPash ♦
  • @ Mike111 create a new question - Ev_Hyper
  • @ Mike111 sorry for answering so late. I did not have time to deal with this, but as I understood it is necessary to read the documentation because technology is still evolving and there is a lot that changes - Aleksey Brekhin

0