My company's code base contains the following C# line:
bool pathExists = Directory.Exists(path);
At runtime, the string path
happens to be the address of a folder on the company's intranet - something like \\company\companyFolder
. When the connection from my Windows machine to the intranet is up, this works fine. However, when the connection goes down (as it did today), executing the line above causes the application to freeze completely. I can only shut the application down by killing it with the Task Manager.
Of course, I would rather have Directory.Exists(path)
return false
in this scenario. Is there a way to do this?