views:

203

answers:

1

I want to add new settings to the user.config at runtime for a C# application (WPF). These settings will be added by independant modules so I have no idea what they will be in advance.

Most examples refer to:

Configuration config = configurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

But this only allows you to access the Application Settings and you can't save it anyway as it's not meant to be modified.

I want to be able to do something like

Settings.Default.Add("SomeKey", "someobject"); Settings.Default.Save()

after which this setting would be available the next time this specific user starts the application.

+1  A: 

You may wish to check this solution.

It is doable but it is lots of code.

Jan
I guess it's easier to simply save an XML file in the Local App directory then for what I'm trying to do
TimothyP