Hello. I am serializing a class and I get the following exception:
You must implement a default accessor on System.Configuration.SettingsPropertyCollection because it inherits from ICollection.
when the following line is executed:
XmlSerializer xs = new XmlSerializer(typeof(CustomConfiguration));
Any help?
public class CustomConfiguration : ConfigurationObjectBase
{
public CustomConfiguration () { //DO NOTHING. }
[User]
public uint Version
{ get { return ((uint)(this["Version"])); }
set { this["Version"] = value; }
}
}
ConfigurationObjectBase is derived from System.configuration.ApplicationSettingsBase.