save a dictionary to app.config
I'm trying to save a dictonary to app.config for my c# winform
I see that i can save a stringdictonary under collections.special but i heard thouse are to be avoided if possible becuase there legacy
is there a way to save a dictonary ( in this case string,string) to the app.config with out haveing to go through a lot of hoops?
thanks
Re: save a dictionary to app.config
A StringDictionary isn't legacy. It wouldn't be under a System namespace if it was. It was part of the Framework before generics existed so it tends not to be used these days but there's no specific reason not to use it. Just as you store a StringCollection in your settings rather than a List<string>, so too you store a StringDictionary rather than a Dictionary<string, string>. I'm fairly sure that application settings doesn't support generic collections at all, although I haven't tested that theory specifically.