title: Reading and writing values in.NET .config files
body: <p>I want to use a custom path for a user.config file, rather than have .NET read it from the default location.  </p>
  
  <p>I am opening the file like this:</p>
  
  <pre><code>ExeConfigurationFileMap configMap = new ExeConfigurationFileMap();
  configMap.ExeConfigFilename = String.Format("{0}\\user.config",AppDataPath);
  Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.PerUserRoamingAndLocal);
  </code></pre>
  
  <p>But I can't figure out how to actually read settings out of it, I get a compile error saying that the values are inaccessible when I try to get a value through AppData or ConfigurationSection.</p>
  
  <p>Do I need to create some sort of a wrapper class to consume the data properly?</p>