I am specifying a System.Collections.Specialized.StringCollection named MyCollection in My.Settings, and upon first use to add a string, a null reference exception is being thrown (i.e. MyCollection is Nothing).
The syntax to add a string is simply:
My.Settings.MyCollection.Add(myString)
How can I initialize a StringCollection from My.Settings if it is null upon first use?
There have been reports of .NET Framework conflicts and StringCollections in My.Settings. Thus, I have .NET Framework 4.6 specified in the project's app settings.
Now your settings grid should look like this:
Instead of this:
And in runtime your settings will be a collection with 0 entries instead of a Nothing collection i.e. it won't crash when you try to use it