[Beta 2, C#] Problem saving Settings when collections are involved

Hi,

this has been bugging me for a while - there seems to be a bug (or more likely, I don't know yet proper way to use it) when some of the Settings are collections.
I am using Settings designer and rely on build process to generate strongly typed Settings.Default class for me, and that works fine. But if I choose a NameValueCollection or StingDictionary or something similar, I cannot save the settings. I have manually set the "key" of this entry to a valid value just prior to calling Properties.Settings.Default.Save but I always get null reference exception. I don't know if it matters WHEN Save is called - I call it in Main as a last function call.

Is the XML serializer capable of saving/restoring collections in beta 2, or was it not supposed to work ever?

Thanks for any hint about this. Note that there was a post few months back describing exactly the same issue, but nobody repliedSad

[971 byte] By [DrazenDotlic] at [2007-12-16]
# 1
No - the collections such as NameValueCollection/StringDictionary do not support XML serialization.

-mark
Program Manager
Microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
Mark Rideout wrote:
No - the collections such as NameValueCollection/StringDictionary do not support XML serialization.

Thanks. You did not say if this was planned or never gonna be implemented (I assume the latter).

Maybe it would be good to mention this in the remarks section of the Settings API. Even better, filtering out types that will not save in the Settings designer would be even better.

DrazenDotlic at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...