Here is the code:
[XmlRoot("Foo")]
class Foo
{
[XmlElement("name")]
string name;
}
[XmlRoot("FooContainer")]
class FooContainer
{
[XmlElement("container")]
List<List<Foo>> lst { get; set; }
}
XmlSerializer s = new XmlSerializer(typeof(FooContainer)); -->Can't pass through this.
Complains about not being able to implicitly cast it blah blah blah,
Anyone can tell what is wrong with this code?
Foo and FooContainer need to be public. Other than that it worked fine for me.Had to flesh out the code a bit, but his works ...I knew someone would mention public so i'll jump in here:
Yes, they need to be public, but that's not the only problem. Actually running a serialization doesn't work (gets the error described)
It doesn't like the List