title: Create Directory on Network Path
body: <p>I have a server application which receives packets of information (basically a file path on a network) from various client applications via WCF.  When it receives the incoming packet, it adds the file path to a list and then launches another process in a backgroundworker thread.  In my backgroundworker DoWork function, I call a function called ProcessFiles() - note I've simplified this function to make the sample easier.</p>
  
  <pre><code>private bool ProcessFiles()
  {
    while (FileList.Count &gt; 0)
    {
      var path = Path.Combine(FileList[0].TargetPath, @"\Translated Files");
      if (!Directory.Exists(path))
      {
        Directory.CreateDirectory(path);
      }
      FileList.RemoveAt(0);
    }
    return true;
  }
  </code></pre>
  
  <p>The function above simply starts working through the FileList and right now the only action I'm trying to do is simply create a new directory inside the target path destination.  Now, this path is likely going to be on a network drive (I'm not sure if that matters)... but the server has access to that location.  When I run my server/client applications and send it a file to process... theoretically it should create the new "Translated Files" folder in the TargetPath destination location... however, nothing ever gets created.  The odd thing is that my DoWork function in my background worker completes its process correctly.  I know this because I have a print statement in my RunWorkerCompleted event handler and it appears to be processing normally.  Does anyone have any ideas why this directory folder is not being created correctly?</p>