title: c# Properties.Settings.Default Doesn't work as expected
body: <p>I've been working on a program to automate my backup checks with LogMeIn backup (a windows forms based program). I now need a way to store user settings, to save information easily. I've never worked with the Application/User settings that is somewhat "built-in" - and decided to try it, but ran into problems. </p>
  
  <p>I added four settings for now: 
  IncludeCriteria (Specialized.StringCollection)
  ExcludeCriteria (Specialized.StringCollection)
  ReportPath (string)
  ReportType (int)</p>
  
  <p>But the behavior doesn't act as expected (go figure). After saving some values in my program, I go back into edit/view my settings values using the VS 2008 settings editor. None of my values are stored. While I think this may be because those values are just default values, wouldn't that be where they can be stored/read/changed?</p>
  
  <p>Here is my load form code (still very unrefined):</p>
  
  <pre><code>private void setupForm()
      {
          txtPath.Text = BackupReport.Properties.Settings.Default.ReportPath == null ? "" : BackupReport.Properties.Settings.Default.ReportPath;
  
          if (BackupReport.Properties.Settings.Default.ReportType == 0)
          {
              radioHTML.Checked = true;
          }
          else
              radioExcel.Checked = true;
  
          if (BackupReport.Properties.Settings.Default.IncludeCriteria.Count &gt; 0)
          {
              listIncludeCriteria.DataSource = Properties.Settings.Default.IncludeCriteria;
  
  
              //foreach (string s in Properties.Settings.Default.IncludeCriteria)
              //    listIncludeCriteria.Items.Add(s);
          }
  
          if (BackupReport.Properties.Settings.Default.ExcludeCriteria.Count &gt; 0)
          {
              listExcludeCriteria.DataSource = BackupReport.Properties.Settings.Default.ExcludeCriteria;
  
              //foreach (string s in Properties.Settings.Default.ExcludeCriteria)
              //    listExcludeCriteria.Items.Add(s);
          }
  
  
  
  
  
      }
  </code></pre>
  
  <p>listIncludeCriteria is just a listbox. When the user saves I call this method:</p>
  
  <pre><code>private void saveSettings()
      {
          //var settings =  BackupReport.Properties.Settings;
          if (txtPath.Text != "")
          {
              BackupReport.Properties.Settings.Default.ReportPath = txtPath.Text;
  
          }
  
          if (listIncludeCriteria.Items.Count &gt; 0)
          {
              //BackupReport.Properties.Settings.Default.IncludeCriteria = (StringCollection)listIncludeCriteria.Items.AsQueryable();
  
  
              foreach (var i in listIncludeCriteria.Items)
              {
                  if (!isIncludeDuplicate(i.ToString()))
                      BackupReport.Properties.Settings.Default.IncludeCriteria.Add(i.ToString());
              }
  
          }
  
          if (listExcludeCriteria.Items.Count &gt; 0)
          {
  
              //BackupReport.Properties.Settings.Default.ExcludeCriteria = (StringCollection)listExcludeCriteria.Items.AsQueryable();
  
              foreach (var i in listExcludeCriteria.Items)
              {
                  if (!isExcludeDuplicate(i.ToString()))
                      Properties.Settings.Default.ExcludeCriteria.Add(i.ToString());
              }
  
          }
  
          if (radioExcel.Checked == true)
              BackupReport.Properties.Settings.Default.ReportType = 1;
          else
              BackupReport.Properties.Settings.Default.ReportType = 0;
  
  
          BackupReport.Properties.Settings.Default.Save();
          //Properties.Settings.Default.Save();
          this.DialogResult = DialogResult.OK;
          this.Close();
  
  
  
      }
  </code></pre>
  
  <p>The wierd thing is when the form loads, the path I put in the first time seems to come up (ReportPath) - even the listBoxes are populated with a bunch of crap I put in - yet I cant find these values anywhere. </p>
  
  <p>Any help would be appreciated!</p>
  
  <p>Josh</p>