End Google Ads 201810 - BS.net 01 --> Hi all...
I'm trying to write to a file with the XmlDocument class. I used the Save(string) method which gets a file ******** and saves the XML to it. the thing is I get an exception:
"The process cannot access the file 'c:\scene.xml' because it is being used by another process".
What is the problem? how can I overcome this? (I want to load the file and then to be able to save on the that file)

some code:
this happens when loading of the file
_currentXMLFile = openXMLFileDialog1.FileName;
System.IO.StreamReader myXMLFileStream = new System.IO.StreamReader(_currentXMLFile);
XmlTextReader myXMLTextReader = new System.Xml.XmlTextReader(myXMLFileStream);
_myXMLDocument = new System.Xml.XmlDocument();
_myXMLDocument.Load(myXMLTextReader);
myXMLDocument is defined at the start of the program so it will have the program's lifespan.

this happens when trying to save the XML document into a file, and throws an exception:
myXMLDocument.Save(fileName);