title: Cannot create instance of type 'System.String'
body: <p>I try to get my section from appsettings.json, and then bind it to the intance of MongoSettings class, but I have an exception which is: </p>
  
  <blockquote>
    <p>"Cannot create instance of type 'System.String' because it is missing
    a public parameterless constructor."</p>
  </blockquote>
  
  <p>It is strange, because I'm using the same method to get jwt settings.</p>
  
  <p>Please take a look:</p>
  
  <pre><code>    var jwtSettings = Configuration.GetSection("jwt").Get&lt;JwtSettings&gt;(); //it works
      var mongoSettings = Configuration.GetSection("mongo").Get&lt;MongoSettings&gt;(); //it doesn't
  </code></pre>
  
  <p>appsettings.json</p>
  
  <pre><code>  "Jwt": {
      "issuer" : "localhost:5000",
      "expiryMinutes" : 60,
      "key" : "das#@4SD120847@12313"
    },
    "Mongo": {
      "connection:" : "mongodb://localhost:27017",
      "database" : "MemoTime"
    }
  </code></pre>
  
  <p>MongoSettings:</p>
  
  <pre><code>public class MongoSettings
  {
      public string Connection { get; set; }
      public string Database { get; set; }
  }
  </code></pre>
  
  <p>JwtSettings:</p>
  
  <pre><code>public class JwtSettings
  {
      public string Key { get; set; }
      public string ValidIssuer { get; set; }
      public int ExpiryMinutes { get; set; }
  }
  </code></pre>
  
  <p>As you can see, both clasess and sections in app settings looks similarly, so why getting settings for mongo does not work?</p>