title: How can I create a file with StreamWriter using a relative path?
body: <p>When I run the following code, an XML file is <strong>correctly created</strong> in <code>c:\temp</code>:</p>
  
  <pre><code>XmlSerializer xs = new XmlSerializer(typeof(ObservableCollection&lt;Models.Customer&gt;));
  using (StreamWriter wr = new StreamWriter("C:/temp/CustomerMock2.xml"))
  {
      xs.Serialize(wr, CustomerList);
  }
  </code></pre>
  
  <p><strong>However</strong>, I actually want it to be created in a <strong>sub-directory</strong> underneath the project, but when I do this:</p>
  
  <pre><code>using (StreamWriter wr = new StreamWriter("Data/CustomerMock2.xml"))
  </code></pre>
  
  <p>it just acts as if it writes it but the file <strong>never appears</strong> in that directory:</p>
  
  <p><code>C:\Projects\Prototype12\CustomersModul\bin\Debug\Data</code>. </p>
  
  <p><strong>How can I create a file with StreamWriter with a relative path inside my project?</strong></p>