Monday, February 5, 2018

Overwritting XML save file Structure issue

Using C# WPF Visual Studio 2017.

I have a strange issue that is intermittent. When overwritting a save file, the root structure will change causing the save file to not work, unless I go in and manually set it back. It is only on overwrite and not on the initial save. It happens randomly, even if I made no changes to the save file.

It only changes the end of the XML </Information> It will either;

1) Add a > so the end result is </Information>>
2) Add an entirely new info. </Information></Information>

This is the end of my Save Function.

 SaveFileDialog sfd = new SaveFileDialog(); sfd.FileName = charname.Text; sfd.Filter = "Character | *.xml"; if (sfd.ShowDialog() == true) { info.Save(sfd.FileName); } } 

Any ideas? I linked the entire function and XML file in this link. https://www.dropbox.com/sh/p9e4xqfi2389l18/AADhHtivM-2Z0vjodV7TUTUEa?dl=0

Overwritting XML save file Structure issue Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team