title: When is an app.config created, when an app.exe.config and what is the difference
body: <p>We have created a WinForms application and store some configurations via the ConfigurationManager class. In order to store the information I use </p>
  
  <pre><code>Configuration pConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
  pConfig.AppSettings.Settings.Add("updates", szUpdatesURL);
  pConfig.Save(ConfigurationSaveMode.Modified);
  </code></pre>
  
  <p>The problem here is that in some occasions the application creates an "appname".config file and in other occasions an "appname".exe.config.</p>
  
  <p><strong>Here I must note that a configuration file is not shipped by default since it is not always required.</strong></p>
  
  <p>The configurations are saved the first time the program is executed. This has caused us a problem, and I cannot specify the occasions when which one or the other is created.</p>
  
  <p>I have performed the tests, on the same pc, with the exact same .exe and I get both results. What's going on here? </p>
  
  <p>What is the difference between the two, and how can I specify which one should be created?
  Many thanks</p>