I need to save the setting in either roaming or local settings. The problem is when i execute the program it shows that setting are stored with a given key and those setting can be retrieved back as well. But when i re-execute or execute the same program later, those saved setting are lost. It again creates them!!
Why setting are not getting saved?
To set the setting, i use following code (setting is a string, value is an object)
ApplicationData.Current.LocalSettings.Values.Add(setting, value);
ApplicationData.Current.RoamingSettings.Values.Add(setting, value);
To retrieve setting, i use following code
ApplicationData.Current.RoamingSettings.Values[setting];
What's the problem with this code?
I was doing a blunder by debugging a test method so setting will not be saved permanently. If you execute your App all your setting will be saved with the above simple coding.