title: Object reference not set to an instance of an object app.config
body: <p>This is my app.config that I added at the root of my project(type:ClassLibrary) : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
     &lt;connectionStrings&gt;
       &lt;add name="POS_DEV_GIL-001" connectionString="Server=FACOX\SQLEXPRESSPOS;Database=POS_DEV_GIL-001;Trusted_Connection=true" providerName="System.Data.SqlClient" /&gt;
     &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I added as reference the System.Configuration.dll</p>
  
  <p>In my code, I do that :</p>
  
  <pre><code>using System.configuration;
  //rest of the code
  String connec = ConfigurationManager.ConnectionStrings["POS_DEV_GIL-001"].ConnectionString;
  </code></pre>
  
  <p>And I get the following error : </p>
  
  <blockquote>
    <p>object reference not set to an instance of an object</p>
  </blockquote>
  
  <p>Do you have a solution?</p>