The trick to effective configuration in any application is to make creating new configuration values and using them in your application drop dead easy.
To me the easiest way to do this is by simply creating a class that holds configuration values, along with a mechanism for easily serializing that configuration data.
Many years ago, when I was just starting out with .
For desktop applications write file rights in the folder are required, which is often not available - with User Account Control on you typically don't have rights to write into the Configuration folder. Personally though, I prefer a more structured approach for configuration management in my applications.
Like everything else in my applications I expect my configuration settings to be based on one or more classes that I can simply add properties to and persist that data easily in my application.
You shouldn't have to think about configuration - it should just work like just about any other class in your projects :-) In my applications, I try to make as many options as possible user configurable and configure everything from user application settings, to administrative configuration details, to some top level business logic options all the way to developer options that allow me to do things like switch in and out of detailed debug modes, turn on logging or tracing and so on.
Configuration information can be varied so it should also be easy to have multiple configuration stores and switch between them easily.
NET and why I think it made sense to maintain a custom configuration solution over the years.
I consider configuration information a vital component of any application and I use it extensively for allowing customization of the application both at runtime and through external configuration settings typically using .config files and occasionally in shared environments with settings stored in a database."magic strings"), or have to write a bunch of code to retrieve values, I'll end up not using them as much as I should, and consequently end up with an application that isn’t as configurable as it could be. If you're like most like developers you probably rely on the App Settings class which provides single level configuration values at the app Settings key. NET provides a fairly easy way to access these configuration values via code from within applications: Easy enough, right?You know the kind that's stored in your web.config or application.config file: All the configuration setting values are stored in string format in the app Settings section of an application's configuration file. But it gets a little more complex if you need to grab a value that's not a string.This is a nice feature, but it's limited to desktop Windows applications Console, Win Forms, WPF and Windows 8 applications. You can load up a configuration, load a section and make changes to it, then write the entire configuration back out to disk assuming you have permissions to do this. Permissions are crucial here and often you will not be able to write configuration back using this approach.For Web applications Full Trust and read/write access to the web.config file are required. It's great that the Configuration Manager is available to provide base features to create simple configuration storage quickly.It's pretty trivial to create some code to arbitrarily take a class and serialize it.