I have a collection of classes that I want to serialize out to an XML file. It looks something like this:
public class Foo
{
public List BarList
It has been over 5 years since this item was posted. I give my experience from July 2013 (.NET Framework 4.5). For what it's worth and to whom it may concern:
When I define a class like so: (VB.Net code)
Public Class MyClass
Public Property Children as List(of ChildCLass)
Public Property MyFirstProperty as string
Public Property MySecondProperty as string
End Class
Public Class ChildClass
Public Property MyFirstProperty as string
Public Property MySecondProperty as string
End Class
With this definition the class is (de)serialized without any problems. This is the XML that comes out of here:
MyFirstProperty="" MySecondProperty=""
MyFirstProperty="" MySecondProperty=""
It only took me two days to figure it out that the solution was to leave out the prefix of the List(of T) elements.