[XmlElementAttribute(Order = 1)]
public int Field1 {...}
[XmlElementAttribute(Order = 2)]
public int Field2 {...}
Catch: You must specify the Order
for all of your members.
Be careful - deserialization will only work if the properties in the XML document are in the same order. Otherwise it will silently ignore out-of-order properties.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…