title: c# can't write to file after creating it
body: <p>My problem is really simple. I create a file, and I can't write to it. BUT if I close the program then re-open when the file is created, it doesn't throw any exceptions. I think when the <code>File.Create</code> method runs, the program locks it.
  <code>path</code> is just a location of a txt file. When I try to delete the file manually, it says my program using it.</p>
  
  <pre><code>if (!File.Exists(path)) File.Create(path);
  
  try
  {
      File.WriteAllLines(path, new string[] {"hi"});
  }
  catch(IOException)
  {
      Console.WriteLine(ex.ToString());
  }
  </code></pre>