I started out using Properties.Settings.Default
to keep settings for my application, but now the requirements have changed, and we need to keep those settings in an SQL database instead of a file on disk. I'll have to load the xml to a string, and then somehow initialize the settings from that string.
I'd rather not have to discard all code related to Properties.Settings.Default
and use a different class. I need something like void Properties.Settings.Default.LoadSettingsXmlFromString(string xml)
, and string Properties.Settings.Default.SaveSettingsToString()
. I would then handle storing and loading the string myself.
One easy solution that comes to mind is to retrieve the settings from the server, and then overwrite the file that Properties.Settings.Default
will load, and likewise for saving.
I also found Loading Properties.Settings from a different file at runtime, but my problem is a little different, since I'm not loading the settings from a file on disk at all.
Edit: It seems even getting the file location so I can overwrite it will not be easy, according to how to change .NET user settings location