title: C# StreamWriter not writing to file
body: <p>basicLog is a list of names and timestamps.  I want to write them to a file.  The two errors I'm getting are on the ';' on the StreamWriter line and on 'file.' on the second line.</p>
  
  <p>The ';' error is:  Possible mistaken empty statement
  The error on file is:  The name 'file' does not exist in the current context.  </p>
  
  <p>The file gets created just fine, but nothing gets written to it.  I'm confused about file not existing in current context, because on the line prior it get's created.  Thank you for any help.</p>
  
  <pre><code>foreach (BasicLog basicLog in emailAttach)
  {
      using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\\sorted.txt", true));
      file.WriteLine(basicLog.LastName + " - " + basicLog.InOrOut + " - " + basicLog.EventTime + "\n");
  }
  </code></pre>