I have a list of information in a string dictionary that I want to store in the app.config for my program.
I've created the entry in the "settings" portion of the program called "extentions" but when I go to use "Settings.Default.Extentions" I get an error that it is null.
Is there a trick or something to using this?
private void LoadextList()
{
listBox1.Items.Clear();
foreach (KeyValuePair<string, string> kvp in Settings.Default.Extentions)
{
listBox1.Items.Add(kvp.Key + "\t" + kvp.Value);
}
}
I don't understand your Extensions problem, but I've used this code before to convert between a string and NameValueCollection - you can easily change it to use a StringDictionary:
Convert NameValueCollection to string:
I've had to make a couple of changes from the code I used, but it should build. Note that it's not too forgiving - the separator characters cannot appear in either the 'key' or 'value' strings.