title: 'MongoDB.Driver.MongoClient' does not contain a definition for 'GetServer' ...first argument of type 'MongoDB.Driver.MongoClient' could be found
body: <p>I'm trying to get familiar with writing to MongoDB from c# programs.  I've set up my code following suggestions from <a href="http://mongodb.github.io/mongo-csharp-driver/1.11/getting_started/" rel="nofollow noreferrer">http://mongodb.github.io/mongo-csharp-driver/1.11/getting_started/</a>  </p>
  
  <p>I'm trying to run this program but getting this error "'MongoDB.Driver.MongoClient' does not contain a definition for 'GetServer' and no extension method 'GetServer' accepting a first argument of type 'MongoDB.Driver.MongoClient' could be found".  May I get some help?</p>
  
  <p>Thanks in advance,
  Tien.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using MongoDB.Bson;
  using MongoDB.Driver;
  //Additionally, you will frequently add one or more of these using statements:
  //using MongoDB.Driver.Builders; //Error rebuilding when this statement is active: "Using the generic type 'MongoDB.Driver.Builders&lt;TDocument&gt;' requires 1 type arguments
  //using MongoDB.Driver.GridFS;
  using MongoDB.Driver.Linq;
  //using MongoDB.Driver.MongoClient; //Error rebuilding when this statement is active "A using namespace directive can only be applied to namespaces; 'MongoDB.Driver.MongoClient' is a type not a namespace 
  
  namespace write2MongoDb
  {
      public class Entity
      {
          public ObjectId Id { get; set; }
          public string Name { get; set; }
      }
  
  
  class Program
  {
      static void Main(string[] args)
      {
          #region Full Sample Program
          var connectionString = "mongodb://localhost";
          var client = new MongoClient(connectionString);
          var server = client.GetServer();
          var database = server.GetDatabase("test");
          var collection = database.GetCollection&lt;Entity&gt;("entities");
  
          var entity = new Entity { Name = "Tom" };
          collection.Insert(entity);
          var id = entity.Id;
  
          var query = Query&lt;Entity&gt;.EQ(e =&gt; e.Id, id);
          entity = collection.FindOne(query);
  
          entity.Name = "Dick";
          collection.Save(entity);
  
          var update = Update&lt;Entity&gt;.Set(e =&gt; e.Name, "Harry");
          collection.Update(query, update);
  
          collection.Remove(query);
  
  
          #endregion
  
  
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>}</p>