title: reading web.config from class library
body: <p>i have two project
  1) class library with no inteface just an api 
  2) web application </p>
  
  <p>from web apps i will be calling the class library api</p>
  
  <p>so i have all the web.config settings in the web application but when i debug it always return me null value and here is the code snippit:</p>
  
  <pre><code> public static string readingDB
          {
              get
              {
                  string result = null;
                  result = ConfigurationManager.AppSettings["employeeDB"]; //conn string
                  if (!string.IsNullOrEmpty(result))
                  {
                      return result;
                  }
                  else
                  {
                      return "";  //???? THROW EXCEPTION???
                  }
              }
          }
  </code></pre>
  
  <p>i have also tried, creating a new app.config in the class library project and have the same appsettings there but does not work...</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;applicationSettings&gt;
      &lt;add name="employeeDB" connectionString="Data Source=servername;Initial Catalog=employee;Persist Security Info=True;User ID=userid;Password=password;"/&gt;
    &lt;/applicationSettings&gt;
    &lt;customErrors mode="On"/&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>any help?</p>