Last post Jun 25, 2015 08:17 AM by Zhi Lv - MSFT
Jun 12, 2015 11:41 AM|dienguis|LINK
I deserialize an xml file like this
public static T DeSerializeObj<T>(this string xmlFullFileName)
var xmlSerializer = new XmlSerializer(typeof(T));
var streamReader = new StreamReader(xmlFullFileName);
var configurationHeaderForm = (T)xmlSerializer.Deserialize(streamReader);
But only two first node of my XML file is deserialised.
How to deserialise all file ?
Jun 12, 2015 12:00 PM|PatriceSc|LINK
Seeing a file example and the corresponding class definition might help to see why it doesn't work. It seems rather some kind if mismatch between the file and the class rather than an issue in the code you shown.
Jun 25, 2015 08:17 AM|Zhi Lv - MSFT|LINK
As for this issue, please check the XML nodes and class properties, perhaps they are not match.
Here are some relevant articles XML Serialization and Deserialization, please refer to them: