title: Can't read app.config in C# .NET Core unit test project with ConfigurationManager
body: <p>I've created a simple unit test project to read an app.config file. Target framework is Core 2.0. I also created a Core 2.0 console app, to sanity-check myself to make sure I wasn't doing anything weird (same test passed as expected in a .NET 4.6.1 unit test project).  </p>
  
  <p>The console app reads the app.config fine, but the unit test method fails and I cannot figure out why. Both are using a copy of the same app.config (not added as a link) and both have the System.Configuration.ConfigurationManager v4.4.1 NuGet package installed.  </p>
  
  <p><strong>The App.config</strong>  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="Test1" value ="This is test 1."/&gt;
      &lt;add key="Test2" value ="42"/&gt;
      &lt;add key="Test3" value ="-42"/&gt;
      &lt;add key="Test4" value="true"/&gt;
      &lt;add key="Test5" value="false"/&gt;
      &lt;add key="Test6" value ="101.101"/&gt;
      &lt;add key="Test7" value ="-1.2345"/&gt;
    &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>The Unit Test</strong>  </p>
  
  <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting;
  using System.Configuration;
  
  namespace ConfigTest
  {
      [TestClass]
      public class UnitTest1
      {
          [TestMethod()]
          public void ConfigTest()
          {
              foreach (string s in ConfigurationManager.AppSettings.AllKeys)
              {
                  System.Console.WriteLine(s);
                  System.Diagnostics.Debug.WriteLine(s);
              }
  
              //AllKeys.Length is 0? Should be 7...
              Assert.IsTrue(ConfigurationManager.AppSettings.AllKeys.Length == 7);
          }
      }
  }
  </code></pre>
  
  <p><strong>The Console App</strong>  </p>
  
  <pre><code>using System;
  using System.Configuration;
  
  namespace ConfigTestApp
  {
      class Program
      {
          static void Main(string[] args)
          {
              foreach (string s in ConfigurationManager.AppSettings.AllKeys)
              {
                  Console.WriteLine(s);
                  System.Diagnostics.Debug.WriteLine(s);
              }
  
              //Outputs 7 as expected
              Console.WriteLine(ConfigurationManager.AppSettings.AllKeys.Length);
          }
      }
  }  
  </code></pre>
  
  <p>Given that I'm still pretty new to the whole .NET Core world, am I doing something totally incorrect here? I sort of just feel crazy at the moment...  </p>
  
  <p><a href="https://i.stack.imgur.com/O8si3.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/O8si3.jpg" alt="Both projects with an app.config"></a></p>