I would like to store usersettings. They are created at runtime and should be read after restarting the application.
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
var property = new SettingsProperty("Testname");
property.DefaultValue = "TestValue";
Settings.Default.Properties.Add(property);
Settings.Default.Save();
}
At this point, the setting is stored and I can access it.
After restarting the application, the newly created setting is away:
public MainForm()
{
InitializeComponent();
foreach (SettingsProperty property in Settings.Default.Properties)
{
//Setting which was created on runtime before not existing
}
}
Trying this piece: Settings.Default.Reload();
didn't affect anything on the outcome. I tried also other things like described here, but neither of them worked for me.