Original Post
As far as I can tell when serializing a number of elements if the list is empty their is no reference to the element name in the output. The problem is that deserializing the non existent list throws a exception so now I have a situation where it serialize fine but can't deserialize. Am I doing something wrong or is their a reason why this happens?
private List<AbilityData> abilities = new List<AbilityData>();
[XmlElement("ability")]
public AbilityData[] Abilities
{
get { return abilities.ToArray(); }
set
{
abilities = new List<AbilityData>();
abilities.AddRange(value);
}
}
public void AddAbility(AbilityData ability)
{
abilities.Add(ability);
}