title: Error CS1503 - Cannot convert from Microsoft.Extensions.Configuration.IConfigurationSection to System.Action<>
body: <p>I am getting an error: </p>
  
  <p><strong>Error CS1503  Argument 2: cannot convert from 'Microsoft.Extensions.Configuration.IConfigurationSection' to 'System.Action&lt;></strong></p>
  
  <p>When I am using Configure with Bind(), it is working. </p>
  
  <pre><code>var bandConfig = new BandSettings();
  Configuration.GetSection("BandSettings").Bind(bandConfig );
  </code></pre>
  
  <p>But with the below code, I am getting the above error.</p>
  
  <p>I tried many solutions suggested in blogs and other forums, 
  For example - <a href="https://stackoverflow.com/questions/46940710/getting-value-from-appsettings-json-in-net-core">Getting value from appsettings.json in .net core</a></p>
  
  <p>but still the same error. Am I missing anything??</p>
  
  <p>I have below things in place:
  <strong>appsettings.json</strong></p>
  
  <pre><code>"BandSettings":{ 
  "UserID": "aTestUserID", 
  "Password" : "aTestPassword" 
  }
  </code></pre>
  
  <p><strong>BandSettings.cs</strong></p>
  
  <pre><code>public class BandWidthSettings
  {
      public string UserID { get; set; }
      public string ApiToken { get; set; }
  }
  </code></pre>
  
  <p><strong>TestHelper.cs</strong></p>
  
  <pre><code>using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  
  public static IConfiguration GetTestConfiguration()
           =&gt; new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();
  
  public IConfiguration Configuration { get; }
  
  public TestHelper(IConfiguration configuration)
  {
      Configuration = configuration;
  }
  public void ConfigureServices(IServiceCollection services)
  {
  
      var config = new BandSettings();
      var bandSettingsSection = Configuration.GetSection("BandSettings");
      services.Configure&lt;BandSettings&gt;(bandSettingsSection);  //Error is getting on this line - bandSettingsSection
  }
  </code></pre>