title: How to read values from 'WPF' project App.config file from within class library
body: <p>I have a WpfApplication project (Visual Studio 2008) with an app.config generated from entering 'Name' and 'Value' pairs in the Settings.settings file (and therefore generating 'applicationSettings' elements rather than 'appSettings' elements). </p>
  
  <p>I have added a class1 class library project in the same Visual Studio solution.</p>
  
  <p>** I have added the WpfApplication app.config file to the class1 project using "add existing item and then add as link".** since found out this is unneccassary (i.e. string a = ConfigurationManager.AppSettings.Get("key1"); below works without this)</p>
  
  <p><strong>I want to read the values within app.config from class1</strong> and have explored the following:</p>
  
  <pre><code>string s1 = Settings.Default.appsetting1; 
  </code></pre>
  
  <p>But I do not want to reference the WpfApplication10 project from Class 1 project and so cannot get a reference to the Settings class. So this syntax only works within the WPF project.</p>
  
  <pre><code>string a = ConfigurationManager.AppSettings.Get("key1").ToString(); 
  </code></pre>
  
  <p>This does work, but only if I add the following to app.config:</p>
  
  <pre><code>&lt;appSettings&gt;
     &lt;add key="key1" value="1"/&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>Are there other ways to achieve what I want which may be better (e.g. offering type safety or being able to read the Settings class properties?</p>