I originally posted a question regarding XMLSerialization: Original Post.
On first run of my solution, it would create a "default" version of my classes and then write them to an xml file.
Using my app, I would add a second class to my list and would try to save the new list by first deleting the original xml doc and then saving into a new one with the same name. But, when checking the new xml file, it would always look exactly like the original file, causing me to think that the XMLSerializer was only writing the first object, and also only writing the first item in a list of string contained within that first object.
In frustration, I removed all XML code and decided to just iterate properties and their values on my class into a list of string and write the property names and values to a file.
Oddly enough, this showed to have same exact problem as my XML code. When I delete my first version of the file (1 object containing properties and a list of string with one item) and try to save a new file (2 objects), I always get the same file as in the first instance, with the default 1 object.
It's almost as if something is restoring my original file, whether it be an xml file through XMLSerialization, or just straight text written to a file.
Any suggestions on where I might look to fix this issue?
I'm stupid. For some reason, the first file is created in the debug directories for the dev environment, but subsequent files are created on my desktop. That's what I get for not specifying a full path to the file being saved. Thanks to all who consider answering!