Check the Setting Type. Application Settings cannot be updated without a custom handler - refer;
Application Settings Overview | Microsoft Docs[
^]
Use your debugger, if the setting is defined but not initialised, it will be null & you cannot add values to it - the blow code works in a Test application - the values are carried over restarts of the application - create a User Setting named
TestList to test;
if(Properties.Settings.Default.TestList == null)
{
MessageBox.Show("Not initialised");
Properties.Settings.Default.TestList = new System.Collections.Specialized.StringCollection();
Properties.Settings.Default.Save();
}
else if(Properties.Settings.Default.TestList.Count > 0)
{
string strMsg = string.Format("List is populated\r\nLast Value: {0}\r\nCount: {1}", Properties.Settings.Default.TestList[Properties.Settings.Default.TestList.Count - 1].ToString(), Properties.Settings.Default.TestList.Count.ToString());
MessageBox.Show(strMsg);
}
else
{
MessageBox.Show("Currently empty");
}
string[] myTest = new string[] { "Value 1", "Value 2" };
foreach(string myVal in myTest)
{
Properties.Settings.Default.TestList.Add(myVal);
}
Properties.Settings.Default.Save();
if (Properties.Settings.Default.TestList.Count > 0)
{
MessageBox.Show("After populate\r\n" + Properties.Settings.Default.TestList[0].ToString()
+ "\r\nCount: " + Properties.Settings.Default.TestList.Count);
}
Kind Regards