title: ConfigurationManager return null instead of string values
body: <p>I am trying to retrieve values from my App.config file which is stored in my working directory, however when I run the program it returns null. I am very confused why this is so, and have looked over the code many times in an attempt to spot an error.</p>
  
  <p>Here is my App.config file code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="provider" value="System.Data.SqlClient" /&gt;
    &lt;/appSettings&gt;
    &lt;connectionStrings&gt;
      &lt;add name="connection" connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=Autos;Integrated Security=True;Pooling=False" /&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here is my C# code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Configuration;
  using System.Data;
  using System.Data.Common;
  
  namespace DataProviderFun
  {
    class Program
    {
      static void Main(string[] args)
      {
        string p = ConfigurationManager.AppSettings["provider"];
        string c = ConfigurationManager.ConnectionStrings["connection"].ConnectionString;
  
        ...
  </code></pre>
  
  <p>When I run this code, p = null and c = null.</p>
  
  <p>I have referenced System.Configuration.dll.</p>