title: This MongoDB deployment does not support retryable writes Exception on ASP.net core
body: <p>I am working on asp.net core and mongo db. Here I am trying to implement transaction support using the below code</p>
  
  <pre><code>using (var session = await _mongoClient.StartSessionAsync())
  {
      try
      {
  
          session.StartTransaction();
          await _dbCollection.InsertOneAsync(session,obj);
          //throw new Exception("No document found");
          await session.CommitTransactionAsync();
      }
      catch (Exception ex)
      {
          //session.AbortTransaction();
          await session.AbortTransactionAsync();
      }
  }
  </code></pre>
  
  <p>But it is throwing exception</p>
  
  <blockquote>
    <p>MongoDB.Driver.MongoCommandException: This MongoDB deployment does not
    support retryable writes. Please add retryWrites=false to your
    connection string.</p>
  </blockquote>
  
  <p>The below code, I am using to create connection</p>
  
  <pre><code>_mongoClient = new MongoClient(config.GetConnectionString("CarGalleryDb"));
          //MongoClientSettings mongoClientSettings = new MongoClientSettings();
          //mongoClientSettings.RetryWrites = false;
  
          _db = _mongoClient.GetDatabase(config.GetConnectionString("DBName"));
  </code></pre>
  
  <p>And my connection string is </p>
  
  <pre><code>"ConnectionStrings": {
  "CarGalleryDb": "mongodb://localhost:27017?retryWrites=false",
  "DBName": "MongoTestDB"
  </code></pre>
  
  <p>},</p>
  
  <p>Can anybody support me to resolve this one?</p>