Configuration Setting Management Article

I have posted a new article here on Configuration Setting management and usage within your .Net applications (ASP.NET or Winforms).

It describes a technique to utilise configuraiton settings within your application in a strongly typed manner, with Visual Studio.NET intellisense support and from multiple sources. It also comes with a configuration class code generator for you to use and play with.

Hope you find it useful and informative.


  • Hey, I like your idea but I don't think you're going far enough. Personally, I would have the settings be read when the app is started and cached thereafter, to avoid the overhead of re-reading whatever the datasource happens to be. This would obviously be more useful when reading from slow sources such as config files or databases. Obviously it would also be valuable to provide a refreshSettings() type function that would reload your cached copy.

    Also, providing the ability to set properties automagically could be useful as well. Granted in webapps (as you seem to be targetting) it wouldn't be too useful. But for desktop type apps abstracting the saving of config data can be quite helpful...

    By the way, first time I've seen your blog but I like it :)



  • Thanks for the comments Brian and yes, I was primarily targetting web apps. The caching would definitely be useful for WinForms apps. I beleive web.config's are cached in a web application scenario but certainly if gathering config data from other sources, caching would be very beneficial.

    All your suggestions are spot on though, and I might expand it later on. I guess as it stands, its left as an excercise for the reader if required ;-)

    Again, thanx for the comments.

Comments have been disabled for this content.