One of my pet hates about the default ApplicationSettings within the .NET framework is the inability to work with multiple values for the same key in the config file (app.config or web.Config)


The built in support suggests that it would be possible to call the System.Configuration.ConfigurationSettings.AppSettings.GetValues("key") method to return a string[] containing all the values for the specified key. Unfortunately, the built in support only returns the last value defined (in my example above, “value3”)

Thankfully there are a number of very easy to use replacements for the standard support, and a variation on the solution proposed in Diego Mijelshon’s article How to make AppSettings work with multiple values for a key is one of the first things that I add into any application which will make use of AppSettings.

Code Project has a number of good articles about extending the default AppSettings support, two others which caught my eye are: