title: Why is File.Create needed to be closed?
body: <p>The following throws an exception "<code>The process cannot access the file 'D:\MyDir\First.txt' because it is being used by another process.</code>"</p>
  
  <pre><code>static void Main(string[] args)
  {
      Directory.CreateDirectory(@"D:\MyDir");
      File.Create(@"D:\MyDir\First.txt");
      File.WriteAllText(@"D:\MyDir\First.txt", "StackOverflow.com");
  }
  </code></pre>
  
  <p>However following works:</p>
  
  <pre><code>using (File.Create(@"D:\MyDir\First.txt"))
  { 
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>File.Create(@"D:\MyDir\First.txt").Close();
  </code></pre>
  
  <p>Why? What in <code>File.Create</code> needs to be closed?</p>