I
illsorted
Guest
Hey all,
Ive written a pretty simple class which inherits from System.Collections.CollectionBase and now Id like to serialize it using the Xml.Serialization.XmlSerializer class so I can write the instance information to disk and retrieve it later.
After I instantiate the class I use this code to try and serialize it (this works with other non-collection classes):
The first line throws the following exception:
An unhandled exception of type System.InvalidOperationException occurred in system.xml.dll
Additional information: Unhandled Exception: System.InvalidOperationException: There was an error reflecting NewCSMailer.CreditSoup.CSMailer.CRecipients. ---> System.InvalidOperationException: You must implement a default accessor on NewCSMailer.CreditSoup.CSMailer.CRecipients because it inherits from ICollection.
----------
Does anyone know what a default accessor is or how I would go about implementing it??
Thanks a bunch,
illsorted
Ive written a pretty simple class which inherits from System.Collections.CollectionBase and now Id like to serialize it using the Xml.Serialization.XmlSerializer class so I can write the instance information to disk and retrieve it later.
After I instantiate the class I use this code to try and serialize it (this works with other non-collection classes):
Code:
mySerializer = New Xml.Serialization.XmlSerializer(GetType(CRecipients))
myWriter = New System.IO.StreamWriter("c:\CRecipients.xml")
mySerializer.Serialize(myWriter, oMsg.GetRecipients)
The first line throws the following exception:
An unhandled exception of type System.InvalidOperationException occurred in system.xml.dll
Additional information: Unhandled Exception: System.InvalidOperationException: There was an error reflecting NewCSMailer.CreditSoup.CSMailer.CRecipients. ---> System.InvalidOperationException: You must implement a default accessor on NewCSMailer.CreditSoup.CSMailer.CRecipients because it inherits from ICollection.
----------
Does anyone know what a default accessor is or how I would go about implementing it??
Thanks a bunch,
illsorted