title: ASP.NET Core: JSON Configuration GetSection returns null
body: <p>I have a file <code>appsettings.json</code> that looks like this:</p>
  
  <pre><code>{
      "MyConfig": {
          "ConfigA": "value",
          "ConfigB": "value"
      }
  }
  </code></pre>
  
  <p>In my <code>Startup.cs</code> I'm building my <code>IConfiguration</code>:</p>
  
  <pre><code>public ConfigurationRoot Configuration { get; set; }
  
  public Startup(ILoggerFactory loggerFactory, IHostingEnvironment environment)
  {
        var builder = new ConfigurationBuilder()
                       .SetBasePath(environment.ContentRootPath)
                       .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)                             
                       .AddEnvironmentVariables();
  
        Configuration = builder.Build();
  }
  
  public void ConfigureServices(IServiceCollection services)
  {
        //GetSection returns null...
        services.Configure&lt;MyConfig&gt;(Configuration.GetSection("MyConfig"));
  }
  </code></pre>
  
  <p>But <code>Configuration.GetSection("MyConfig")</code> always returns <code>null</code>, although the value exists in my JSON file. <code>Configuration.GetSection("MyConfig:ConfigA")</code> works just fine.</p>
  
  <p>What am I doing wrong?</p>