I have several objects that I'm saving to disk via the XmlSerializer. 80% of
the time this works fine, but occasionaly it will create a file like this:
<?xml version="1.0"?>
<SystemOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<AssetDirectory>C:\Documents and Settings\sklett\Local
Settings\Temp\</AssetDirectory>
<ProductLabelPrinter>Adobe PDF</ProductLabelPrinter>
</SystemOptions>
</SystemOptions>
Note the double </SystemOptionstags. Anyone ever run into this?
Here is the code doing the serialization in case it helps:
<code>
public void Save()
{
using (FileStream stream = File.Open(FullPath,
FileMode.OpenOrCreate, FileAccess.Write))
{
_serializer.Serialize(stream, this);
stream.Close();
}
}
</code>
Thanks for reading,
Steve