linq to XML doc.save is failing, c#
Posted on 2014-01-24
I have a c# program that creates an xml document using linq to xml:
XDocment doc = new XDocument();
there are over 600 lines of logic building this xml file, culminating in:
string fName = this._writepath + "file856" + curDateTime + ".xml";
at doc.Save I am getting an error: This operation would create an incorrectly strucutred document.
Unfortunately, this error doesn't happen in my development environment, only in the delivery environment (the executable on the client's machine).
Is there anything I can do to get the executable to show me the structure of the xml so that I can see where it's malformed? In other words, since doc.Save fails, is there some way to throw it into a viewer or a NotePad or something else that would allow me to look at it?