Thanks for the reply! We've figured out already what's causing the problem. The remote computer, where the file being read is located, has been rebooted; and some necessary services in that computer did not start after the reboot. The reboot also caused file sharing to be turned off. These have made the remote computer inaccessible to the machine where the File.ReadAllText() method has been called.
This is *very* unusual. I can only imagine that some kind of misbehaving DLL got injected into your program and has a bug, closing the wrong file handle. A virus scanner could be the source of that. That should be intermittent. If this consistently fails, there is something very wrong with the machine. Hans Passant.
Thanks for the reply! We've figured out already what's causing the problem. The remote computer, where the file being read is located, has been rebooted; and some necessary services in that computer did not start after the reboot. The reboot also caused file sharing to be turned off. These have made the remote computer inaccessible to the machine where the File.ReadAllText() method has been called.