I've added a StringDictionary to my project settings in VS2010. When I try to add members to it in my program, I get a NullReferenceException
. When I try to initialize a value in its Value
column in my project settings, it says my entry cannot be converted to StringDictionary. I'm sure it's looking for some XML code, but isn't there a better way to initialize the StringDictionary before compilation?
Additional info:
Go to Menu -> Project -> [Project Name]> Properties... -> Settings
Add a setting named
mySetting
of typeSystem.Collections.Specialized.StringDictionary
In your code add a line
[ProjectName].Properties.Settings.Default.mySetting.Add("key","value");
Run and get the exception.