title: File.Create seems to lock the file. How can I avoid this?
body: <p>I have 2 threads that communicate by sending files to each other. When Thread #1 does a</p>
  
  <pre><code>// Thread #1
  File.Create(@"C:\somedir\response.done");
  </code></pre>
  
  <p>Then Thread #2 is supposed to delete it.</p>
  
  <pre><code>// Thread #2
  while (!File.Exists(@"C:\somedir\response.done"))
      Thread.Sleep(100);
  
  
  while (File.Exists(@"C:\somedir\response.done"))
      {
          try {
                 File.Delete(@"C:\somedir\response.done");
              }
          catch { Thread.Sleep(1000); };
  
      }
  </code></pre>
  
  <p>However, the file seems to be locked. There is generated a response.done file in the directory, but it is never deleted. When I try to manually remove it, then </p>
  
  <p>"The action cannot be completed because the file is open in MyProgram. Close the file and try again."</p>
  
  <p>How can I avoid this?</p>