File.Exists not working on network drive
<p>My console app checks for the presence of a file on a network drive and logs a message when it does not exist. Today I deployed my app to a QA machine and File.Exists() has been returning false for files that do exist. I am running the app via windows task scheduler. When I ran it from the command line it seems to work fine. But either way I don't trust it now. Has anyone seen this behavior or have any insight?:</p>

<pre><code>Using System.IO;

private static void Main()
{
    var fileName = @"x:\folder\file1.txt"; //be a network share
    If (!File.Exists(fileName) 
    {
        LogMessage("File is not on disk.");
    }
    else
    {
        LogMessage("File is on disk.");
    }
}
</code></pre>