title: Reading settings from app.config or web.config in .NET
body: <p>I'm working on a C# class library that needs to be able to read settings from the <code>web.config</code> or <code>app.config</code> file (depending on whether the DLL is referenced from an ASP.NET web application or a Windows Forms application).</p>
  
  <p>I've found that</p>
  
  <pre><code>ConfigurationSettings.AppSettings.Get("MySetting")
  </code></pre>
  
  <p>works, but that code has been marked as deprecated by Microsoft.</p>
  
  <p>I've read that I should be using:</p>
  
  <pre><code>ConfigurationManager.AppSettings["MySetting"]
  </code></pre>
  
  <p>However, the <code>System.Configuration.ConfigurationManager</code> class doesn't seem to be available from a C# Class Library project.</p>
  
  <p>What is the best way to do this?</p>