How do I add a default accessor to a collection class

  • Thread starter Thread starter Lou
  • Start date Start date
L

Lou

I getthis error when trying to serialize a collection class.

Dim Serialize As XmlSerializer = New XmlSerializer(GetType(cButtons))


"You must implement a default accessor on MyCollection.cButtons because it
inherits from ICollection.
 
You must have a default "New" with no arguments. The serialization wants to
be able to create the class and if there are only constructors with
parameters it cannot perform its duty.
 
There is one

Public Sub New()

End Sub

Lloyd Sheen said:
You must have a default "New" with no arguments. The serialization wants
to be able to create the class and if there are only constructors with
parameters it cannot perform its duty.
 
Back
Top