title: .net config file AppSettings: NameValueCollection vs. KeyValueConfigurationCollection
body: <p>When accessing the current application's appSettings, I get a NameValueCollection:</p>
  
  <pre><code>NameValueCollection settings =
      ConfigurationManager.AppSettings;
  </code></pre>
  
  <p>When accessing another application's appSettings, I get a KeyValueConfigurationCollection:</p>
  
  <pre><code>KeyValueConfigurationCollection settings = 
      ConfigurationManager.OpenExeConfiguration(sExe).AppSettings.Settings;
  </code></pre>
  
  <hr>
  
  <ol>
  <li><p>Is there a reason why these two methods (<a href="http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.appsettings.aspx" rel="noreferrer">ConfigurationManager.AppSettings</a> and <a href="http://msdn.microsoft.com/en-us/library/system.configuration.appsettingssection.settings.aspx" rel="noreferrer">AppSettingsSection.Settings</a>) have similar but different (and incompatible) return types? Maybe I'm using an outdated method in one of the two cases?</p></li>
  <li><p>Is there an easy way to get the same type in both cases, i.e., to get a NameValueCollection for another application's appSettings or a KeyValueConfigurationCollection for the currently running application's appSettings?</p></li>
  </ol>
  
  <hr>
  
  <p><strong>Update</strong>: For question 2, I've found the following way to get the configuration of the <em>currently running</em> (non-web) application as a KeyValueConfigurationCollection:</p>
  
  <pre><code>KeyValueConfigurationCollection settings = 
      Configuration.ConfigurationManager.OpenExeConfiguration(Configuration.ConfigurationUserLevel.None).AppSettings.Settings;
  </code></pre>