title: Reading a key from the Web.Config using ConfigurationManager
body: <p>I am trying to read the keys from the <code>Web.config</code> file in a different layer than the web layer (Same solution)</p>
  
  <p>Here is what I am trying:</p>
  
  <pre><code>string userName = System.Configuration.ConfigurationManager.AppSettings["PFUserName"];
  string password = System.Configuration.ConfigurationManager.AppSettings["PFPassWord"];
  </code></pre>
  
  <p>And here is my <code>appSettings</code> in the <code>Web.config</code> file:</p>
  
  <pre><code>&lt;configuration&gt;
     ....
     &lt;appSettings&gt;
        &lt;add key="PFUserName" value="myusername"/&gt;
        &lt;add key="PFPassWord" value="mypassword"/&gt;
     &lt;/appSettings&gt;
     ....
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I debug the code <code>username</code> and <code>password</code> are just <code>null</code>, so it is not getting the value of the keys.</p>
  
  <p>What am I doing wrong to read these values?</p>