Using this answer: https://stackoverflow.com/a/453230/3012708 I thought i'd successfully implemented saving of settings in my C# application.
However, the saving never seems to happen - the applications config file is never updated, and if i add some code to be called from SettingChangingEventHandler or SettingsSavingEventHandler it's never called.
I added settings as desribed in the answer referenced above. 4 bool values in "User" scope, with the Access Modifier setting left at "Internal".
In my code i call:
Using MyApplication.Properties;
Then to set the setting "Interval", i do:
Settings.Default.Interval = true;
And to save:
Settings.Default.Save();
If i check the MyApplication.exe.config file, i see the setting is there, like:
<userSettings>
<MyApplication.Properties.Settings>
<setting name="Interval" serializeAs="String">
<value>False</value>
</setting>
</MyApplication.Properties.Settings>
</userSettings>
However, it still has it's original value - false.
Any ideas?
I tried without the "Using..." code, and using the full code to update:
MyApplication.Properties.Settings.Default.Interval = true;
MyApplication.Properties.Settings.Default.Save();
I also tried running the application as Admin outside of Visual Studio - no luck.