I\'m getting an exception: The process cannot access the file.
Here\'s the code:
if (!Monitor.TryEnter(lockObject)) return; try { watcher.Ena
It may be because of the watcher (then FileShare.ReadWrite is the important part).
Try:
XmlDocument xdoc = new XmlDocument(); FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); xdoc.Load(fs);