2011-11-17, 12:17 AM
Yeah mine too. I've been playing with a settings class, and have effectively had to implement the following:
This is kinda an example. So this code is in a settings class.
If I serialise the List<Server> object directly it works.
But trying to serialise the Settings class (which this internal list) fails - unless I do what I've done here and convert it to an array.
Code:
List<Server> servers;
[XmlIgnore()]
[Browsable(false)]
public List<Server> Servers { get; set }
public Server[] ServerArray { get return this.servers.ToArray(); }
This is kinda an example. So this code is in a settings class.
If I serialise the List<Server> object directly it works.
But trying to serialise the Settings class (which this internal list) fails - unless I do what I've done here and convert it to an array.