title: appsettings.json in ASP.net Core 2.0 Preview configuration GetSection null
body: <p>I was trying to call <code>GetSection</code> from injected configuration in the <code>Startup.cs</code>.
  The Value was <code>null</code>, while <code>indexer</code> to a concrete section value returns <code>non-null</code> value. It seems to me a bug behind the <code>GetSection</code> method or I am wrong with it?</p>
  
  <p><strong>appsettings.json:</strong></p>
  
  <blockquote>
    <p>{   "MyConfig": {
        "ConfigA": "valueA",
        "ConfigB": "valueB"   } }</p>
  </blockquote>
  
  <p><strong>Program.cs:</strong></p>
  
  <pre><code>    public static void Main(string[] args)
      {
          var host = BuildWebHost(args);
          host.Run();
      }
  
      public static IWebHost BuildWebHost(string[] args) =&gt;
          WebHost.CreateDefaultBuilder(args)
              .UseStartup&lt;Startup&gt;()
              .Build();
  </code></pre>
  
  <p><strong>Startup.cs:</strong></p>
  
  <pre><code>public class Startup
  {
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public IConfiguration Configuration { get; }
  
      // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)
      {
          services.AddMvc();
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
          var mySection = this.Configuration.GetSection("MyConfig");
  
          var myVal = this.Configuration["MyConfig:ConfigA"];
  </code></pre>