title: Getting non-deterministic error while copying file to a network shared folder using File.Copy()
body: <p>I am copying several backup files which includes small to large files that is greater that 1 TB from a local folder to a network shared folder using <em>C#</em> <strong>File.Copy()</strong> function. Previously this worked well. But in recent times I am facing different types of exception at different time. I also tried using the <strong>NET USE</strong> command to create a shared path connection even though the credentials are the same to resolve this problem.</p>
  
  <pre><code>File.Copy(sourceFilePath, destinationFilePath, overwrite);
  </code></pre>
  
  <p>The exceptions I am getting are:<br>
  - <strong>Error:</strong> Could not find file.<br>
  - <strong>Error:</strong> The handle is invalid.<br>
  - <strong>Error:</strong> There are currently no logon servers available to service the logon request.<br>
  - <strong>Error:</strong> The specified network name is no longer available.  </p>
  
  <p>NB: These exceptions are not for invalid file path. Because exceptions occurs after copying some portions of the file and same code was worked before for the same files.</p>
  
  <p>Anyone have the idea to resolve this kind of situation?</p>