C# .Net file in use issue
- by Dan
I'm having an issue opening files that have recently been closed by the .Net framework. Basically, what happens is the following:
-Read in an XML file using DataSet.ReadXml()
-Make some changes to the data
-Write out the XML file using DataSet.WriteXml()
-Copy the XML file to a new location using File.Copy
-FTP the file using a custom control
This sequence can intermittently fail either after the WriteXML or the File.Copy with a file in use exception.
I'm guessing it could be the Windows write cache not flushing right away. Can anyone confirm that this could be causing my issue? Any solutions to suggest?
Thanks,
Dan