Quote:Original post by Rainweaver
Afaik, XML serializer doesn't like properties... so that's something you might want to check. Upgrade your private vars to public. Make sure you also have a parameterless constructor which initializes your collections, so that the serializer can call it before actually populating the lists.
Hope this helps.
Please do not follow any of this advice. It is really a bad idea.
First of all, XML serialization works just fine with properties as long as you understand what is going on.
When you have a collection if have a bit of a different issue. The XmlSerializer only serializes the elements in the collection when it detects either the IEnumerable or the ICollection interface. So if you don't have either then it skips those items in your collection.
So you have two choices, either add IEnumerable to your FileGroup class (this is my recommendation) or do custom serialization. Do do custom you need to inherit from ISerializable interface, then you need to make a serilization constructor with the two parmaters; SerializationInfo info, StreamingContext context, finally need to override void GetObjectData(SerializationInfo si, StreamingContext context). That is it.
theTroll