chrizyuen
chrizyuen

Reputation: 32

C# Deserialization problem into new class structure

I have 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 ?

Upvotes: 0

Views: 185

Answers (1)

BrendanS
BrendanS

Reputation: 331

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.

Upvotes: 2

Related Questions