title: How to use configuration manager in .net core 3.1
body: <p>I have a package reference in my project which is a .Net core XUnit Test project. This package has CoverageItem constructor as below</p>
  <pre><code>public CoverageItem()
  {
    this._minimumPercentage = Helper.GetMinimumPercentageValue();
    this._maximumPercentage = Helper.GetMaximumPercentageValue();
    this._minimumCurrency = Helper.GetMinimumCurrencyValue();
    this._maximumCurrency = Helper.GetMaximumCurrencyValue();
    this._minimumDays = Helper.GetMinimumDaysValue();
    this._maximumDays = Helper.GetMaximumDaysValue();
  }
  </code></pre>
  <p>where the Helper.GetMinimumPercentageValue() is</p>
  <pre><code>public static int GetMinimumPercentageValue()
  {
    int result;
        if (!int.TryParse(ConfigurationManager.AppSettings[&quot;MinimumPercentageValue&quot;], NumberStyles.Any, (IFormatProvider) CultureInfo.CurrentCulture, out result))
            throw new MissingFieldException(&quot;ConfigurationFile&quot;, &quot;MinimumPercentageValue&quot;);
    return result;
  }
  </code></pre>
  <p>In the test case, I need to create an instance of the CoverageItem as</p>
  <pre><code>var coverageItem = new CoverageItem();
  </code></pre>
  <p>Hence I installed the package System.Configuration.ConfigurationManager 4.7.0 and created a new app.config file</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;        
      &lt;add key=&quot;MinimumPercentageValue&quot; value=&quot;1&quot; /&gt;
      &lt;add key=&quot;MaximumPercentageValue&quot; value=&quot;200&quot; /&gt;    
    &lt;/appSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  <p>Still my test case fails at the line where it creates the CoverageItem with the exception</p>
  <blockquote>
  <p>System.MissingFieldException : Field 'ConfigurationFile.MinimumPercentageValue' not found.</p>
  </blockquote>