I don’t have experience with this so perhaps I’m using the wrong terminology.
The scenario is this: I’m serializing a class instance to a file using the code from https://stackoverflow.com/a/12309136/939213 . But at some point I might want to change the class a bit, so I would like to insert an int into the file telling the program what version of the class this is.
I tried serializing the int and the class into the same file but discovered that’s impossible, so I’m now thinking of having an int property in the class for that, and reading that first, in order to know what class should be deserialized.
So how do I read that int alone?
EDIT: For example, to read the myInt in this:
<MyClass xml...>
<myInt>10</myInt>
<myString>abc</myString>
</MyClass>
You need to provide some example xml if you want a specific answer, otherwise you can check out Linq-To-Xml for more info.