title: Using app.config in .Net Core
body: <p>I have problem. I need to write a program in .Net Core(C#) which use app.config like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="custom" type="ConfigurationSample.CustomConfigurationSection, ConfigurationSample"/&gt;
    &lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="sampleDatabase" connectionString="Data Source=localhost\SQLExpress;Initial Catalog=SampleDatabase;Integrated Security=True"/&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="sampleApplication" value="Configuration Sample"/&gt;
    &lt;/appSettings&gt;
    &lt;custom&gt;
      &lt;customConfigurations&gt;
        &lt;add key="customSample" name="Mickey Mouse" age="83"/&gt;
      &lt;/customConfigurations&gt;
    &lt;/custom&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and I write:</p>
  
  <pre><code>string connectionString = ConfigurationManager.ConnectionStrings["sampleDatabase"].ConnectionString;
  Console.WriteLine(connectionString);
  
  // read appSettings configuration
  string appSettingValue = ConfigurationManager.AppSettings["sampleApplication"];
  Console.WriteLine(appSettingValue);
  </code></pre>
  
  <p>and it is example from the internet so I thought would work, but I am getting exceptions:</p>
  
  <pre><code>System.Configuration.ConfigurationErrorsException: 'Error Initializing the configuration system.'
  Inner Exception
  TypeLoadException: Could not load type 'System.Configuration.InternalConfigurationHost' from assembly 'CoreCompat.System.Configuration, Version=4.2.3.0, Culture=neutral, PublicKeyToken=null' because the method 'get_bundled_machine_config' has no implementation (no RVA).
  </code></pre>
  
  <p>I downloaded via NuGet - Install-Package CoreCompat.System.Configuration -Version 4.2.3-r4 -Pre and still don't work. Maybe someone can help me? </p>