How do I add a default accessor to a collection class

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.
 
L

Lloyd Sheen

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.
 
L

Lou

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top