title: ConfigurationManager does not point to correct app.config
body: <p>I am trying to use <code>ConfigurationManager</code> to get the connection string from a project call <em>FileShareAccessLibrary</em>.</p>
  
  <p>This is the code I am writting in order to do this:</p>
  
  <pre><code>ConfigurationManager.ConnectionStrings["FileShareAccessLibrary"].ConnectionString
  </code></pre>
  
  <p>This is the content of app.Config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;&lt;/configSections&gt;
    &lt;connectionStrings&gt;
      &lt;add name="FileShareAccessLibrary" connectionString="......"
        providerName="System.Data.SqlClient" /&gt;
      &lt;add name="FileShareAccessLibrary.Properties.Settings"
        connectionString="..."
        providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I run my app I get a <code>NullReferenceException</code> because <code>ConfigurationManager.ConnectionStrings["FileShareAccessLibrary"]</code> returns null.</p>
  
  <p>While debugging I noticed that none of the two connection strings are stored inside <code>ConfigurationManager.ConnectionStrings</code> so I figured that the <code>ConfigurationManager</code> is pointing to another file.</p>
  
  <p>In my project I have not other <code>app.config</code> file.</p>
  
  <p>Is there something I am doing wrong here?
  Why is <code>ConfigurationManager</code> not getting my connection string?</p>