title: VS project Settings is building a .config file with no <appSettings> or <add> elements
body: <p>I started adding settings to my C# project in VS2010, by adding rows in the Project -> Properties -> Settings tab.  A Settings.settings file (with Settings.Designer.cs file) was automatically generated under Properties.</p>
  
  <p>But when I try to access some settings in the code like <code>ConfigurationManager.AppSettings["NameOfSetting"]</code> it always returns null; AppSettings.Count is always 0. Furthermore I checked the bin folder and when I build the project, <em>there is no MyProjectName.exe.config file or app.config file</em> there.</p>
  
  <p>What might have wrong with the VS project?  How do I force it to create the .exe.config file like it's supposed to?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I completely removed/deleted the app.config and Settings files from my project then re-added one setting in the project properties, to re-create it from scratch. When I built the project again, this time a ProjectName.exe.config file <em>is</em> in the \bin folder. But my code gets the same results: ConfigurationManager.AppSettings["MySetting"] is null and AppSettings.Count = 0. </p>
  
  <p>Here is the auto-generated app.config file, in the project folder, which is identical to the Project.exe.config file created in a build:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  &lt;configSections&gt;
      &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" &gt;
          &lt;section name="MyDarnProject.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;
      &lt;/sectionGroup&gt;
  &lt;/configSections&gt;
  &lt;applicationSettings&gt;
      &lt;MyDarnProject.Properties.Settings&gt;
          &lt;setting name="MySetting" serializeAs="String"&gt;
              &lt;value&gt;21937058&lt;/value&gt;
          &lt;/setting&gt;
      &lt;/MyDarnProject.Properties.Settings&gt;
  &lt;/applicationSettings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I notice that the element is named applicationSettings, not appSettings as expected. And the setting itself is totally different, with a  element and  child element, instead of <code>&lt;add key="MySetting" value="21937058"/&gt;</code> like in others' examples.  I'm using Visual Studio Professional 2010, Version 10.0.40219.1 SP1Rel</p>
  
  <p>The Settings.Designer.cs code has everything exactly as in an example given below, except that there's no set to go with the get but I don't think that's a big deal.</p>
  
  <pre><code>[global::System.Configuration.ApplicationScopedSettingAttribute()]
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  [global::System.Configuration.DefaultSettingValueAttribute("21937058")]
  public long MySetting {
      get {
          return ((long)(this["MySetting"]));
      }
  }
  </code></pre>
  
  <p><code>MyProject.Properties.Settings.Default.MySetting</code> does access the setting value! So I guess I may have to do it that way; I'm going to consider that a <em>workaround</em> since I still have no clue why the project isn't building the ProjectName.exe.config file the way every other project I've ever made does.</p>