none
How to programmatically create new application settings? RRS feed

  • Question

  • I know the basics of Properties.Settings and how to load/save values.. values I've already defined in design-time.  I'm wondering how to create new settings programmatically.  It's proving to be a huge challenge, and the documentation is very vague.

    Hoping someone can point me in the right direction...

    Friday, August 4, 2006 5:44 AM

All replies

  • Hi,

    Do you mean you want something like this? It's about the appSettingSection. You can use it to add and save the settings. Have a try at the example code.

    Tuesday, August 8, 2006 8:21 AM
  • OK.. so that whole Properties.Settings thing is deprecated usage, and I should be using ConfigurationManager to manage application settings? At least that's what the ConfigurationManager help page says. "The ConfigurationManager class allows you to access machine and application configuration information. Using ConfigurationManager is the preferred way to work with configuration files for client applications; all other methods are deprecated."

    EDIT: Ok, this is weird.. System.Configuration.Configuration doesn't exist, even though MS help docs use it in sample code.  And the code you linked to also doesn't work for me either (System.Configuration.ConfigurationManager doesn't exist)
    Tuesday, August 8, 2006 2:53 PM