Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

XmlDocument isn't Releasing My XML File for Saving

$
0
0

I would like to load an XML from a file, modify it, then save the XML to itself. However, I am getting an error when I try to write to the same file. I can create a new file, but that is not my goal. Since there is no close/dispose option for XmlDocument, I don't know how to force it. I did try GC.Collect() even though it is not recommend, but it didn't help either-way.


Dim ShipXMLDocument As XmlDocument = New XmlDocument()
ShipXMLDocument.Load(FilePath)

'Modify XML....

ShipXMLDocument.Save(FilePath)

I am new at coding so please explain the solution like I am a 7 year old.

Thank you!

Thank you!


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>