title: After executing File.Delete, the file remains in DELETE PENDING
body: <p>How is it possible that after calling <code>File.Delete</code> the file still exists sometimes? I used simple code to reproduce the issue using <code>File.Open</code>. The expected exception is <code>FileNotFoundException</code>. I checked the operation in Process Monitor v3.05 and the result for the file is "DELETE PENDING" and throwns <code>UnauthorizedAccessException</code>. Does anyone have an explanation for it?</p>
  
  <pre><code>public class Program
  {
      private const string DummyFileName = "dummy.txt";
  
      private static void Main(string[] args)
      {
          int attempt = 0;
          while (true)
          {
              using (File.Create(DummyFileName))
              {
              }
  
              File.Delete(DummyFileName);
  
              try
              {
                  attempt++;
                  using (File.Open(DummyFileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
                  {
                  }
              }
              catch (FileNotFoundException)
              {
              }
              catch (UnauthorizedAccessException ex)
              {
                  Console.WriteLine("File exists{0}", File.Exists(DummyFileName));
                  Console.WriteLine("File remains in DELETE PENDING state in attempt {0}.", attempt);
                  Console.WriteLine(ex);
                  Console.ReadKey();
              }
          }
      }
  }
  </code></pre>