title: How to create text file in .NET project folder, not in bin/Debug folder where is by default
body: <p>I have a very simple .NET console application in Visual Studio. I am trying to write some words into a text file. </p>
  
  <pre class="lang-cs prettyprint-override"><code>using (StreamWriter file = File.AppendText("log1.txt"))
  {
         file.WriteLine("Hello from the text file");
  }
  </code></pre>
  
  <p>If the file does not exist, the application creates it in the autogenerated folder bin/Debug. 
  Is there a way to create this file in the project's directory, where I have .csproj file?</p>
  
  <p>And more important, in real-world applications, when you work with files, you keep them in bin/Debug? That's why .NET creates them there firstly?</p>