title: Get appSettings configSource from code
body: <p>Is there a way to retrieve configSource from code? I founded <a href="https://stackoverflow.com/questions/8351377/how-to-programmatically-retrieve-the-configsource-location-from-config-file">How to programmatically retrieve the configSource Location from config file</a>, but all answers are wrong. </p>
  
  <p>I have following config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;appSettings configSource="appsettings.config"/&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I tried to invoke following code:</p>
  
  <pre><code>var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  var file = config.AppSettings.File;
  </code></pre>
  
  <p><code>file</code> is always empty. Same is for <code>ConfigurationManager.AppSettings["configSource"]</code>. I think something changed in .NET 4, because answers are old ones.
  I tried also <code>config.AppSettings.SectionInformation.ConfigSource</code> but it is also empty.</p>
  
  <p>I need this path to enable monitoring of <code>appSettings</code>. You could read more: <a href="https://stackoverflow.com/questions/18211125/how-to-discover-that-appsettings-changed-in-c">How to discover that appsettings changed in C#?</a></p>