开发者

C# Deserialization problem into new class structure

I 开发者_如何学Gohave a class and serialized into XML on hard disk. Then I add one new parameter into that class. Can I still able be de-serialize from old xml into new class structure by default de-serializer?

Any things else might affect serialization? Rename parameters ? Delete parameters ?


I will assume by parameters you are referring to instance variables.

XMLSerializer will just put back the data it can find. Even if you removed (or renamed) a variable it will still be happy.

If however you are saying that you have added a parameter to the constructor just be aware that XMLSerializer requires a parameterless constructor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜