views:

123

answers:

1

Hello from a long time lurker, first time poster.

I am working on a C# app with a custom config section to save ftp account information. When I come out with a new revision, all the information saved in the previous release is gone.

I've tried using Properties.Settings.Default.Upgrade(), but that only updates usersettings and not custom config sections.

Preferably I rather use the built in ConfigurationManager but I am contemplating either handling the the various settings I use manually through xml or creating and using a class that can be serialized.

Any suggestions? Thanks.

A: 

I wrote a post about creating and using custom configuration sections on my blog a while back, but nothing has changed since then so it still valid. http://jaimalchohan.wordpress.com/2008/04/29/custom-configuration-sections/

Custom config sections are rather powerful and do provide you with a level of control far suerior to that of just using COnfigurationManager.AppSettings. However it probably not worth it if all you have are a handfull settings.

Over just using XML with an XML reader, you get benefits of not having to write the code to populate your own custom bjects, default values, required values and also some basic string validation. Custom Configuration Sections are a decent way to go.

Jaimal Chohan
Doesn't have anything on versioning however? Seems to me he already has a working custom section.
Thorarin