When I use XML serialization, there will be an extra trailing '>' #71709
-
Something like this
The code I serialize
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I use it for archiving in the game of unity. |
Beta Was this translation helpful? Give feedback.
-
This is happening because You need to use |
Beta Was this translation helpful? Give feedback.
This is happening because
File.OpenWrite
does not truncate the file when it opens it. That extra>
isn't being written, it's left over from the previous save. (See the remarks section of the documentation for details)You need to use
File.Create
instead.