title: Appending data to a text file within asp.net mvc project structure/tree (how to address the file?)
body: <p>I am working on a simple landing page for a project that is sheduled to release in a couple of months. People can use a form to sign up to be notified on release. Currently the form simply generates an email saying "email adresse foo@bar.com wants to be notified on release" and sends it to me.</p>
  
  <p>Now I want to save the data from the form into a simple text file so I can more easily feed it to my email programm later. In Visual Studio I created a new folder in my project named "subscriptions" and in that folder created an emptry text file release_notification_emails.txt". I tried using the <code>StreamWriter</code> to write to the file, but it failed. Here is my code:</p>
  
  <pre><code>using (StreamWriter writer = new StreamWriter("/subscriptions/release_notification_emails.txt", true))
          {
              writer.WriteLine(eMail);
          }
  </code></pre>
  
  <p>It results in the following exception/error</p>
  
  <pre><code>Could not find a part of the path 'C:\subscriptions\release_notification_emails.txt'.
  </code></pre>
  
  <p>So it looks like it treats the path parameter of the StreamWriter as relative to the file system root instead of the project root, which is problematic. I use paths relative to the project root all the time to include images, scripts, views, etc. It seemed to me that this was the standard way asp.net does this (I AM very new to asp.net though, you can probably tell).</p>
  
  <p>So my question ow is: How can I write to a text file that is within my project/solution file tree? It doesn't have to use the <code>StreamWriter</code> I just want it to work. It needs to be within the project file tree so that it will be tracked by out version management system and colleagues working on the project have the same file.</p>