This is the scenario, I have an application that overwrites an xml file every 2secs. And then I have this c# application, that reads this file every 1-2secs. this process runs fine, but there are times when i get the error saying,
Process cannot access file because it is used by another process
I am using xmldocument.load to open and read the xml file.
What can i do to solve this issue? I have tried running on different machines, and this is absolutely random, as on my machine, it ran for 6 hours before the error, on another machine,
Coz my c# program will continue reading this file, unless the user click a button to stop the data logging process
As i want the program to continue running as long as the user doesn't stop it. Please help