title: Accessing a text file in a WPF project
body: <p>I feel like I'm missing something obvious here...</p>
  
  <p>I've got a text file in my WPF application which is located in a subfolder, so apologies for advance for the terrible ASCII.</p>
  
  <pre><code>+Project
  +--+Subfolder
  |  +--TextFile.txt
  |
  +--App.config
  +--App.xaml
  +--etc.
  </code></pre>
  
  <p>The build action on this text file is Resource and I'm trying access the content as a string in my program, but I have absolutely no idea what I'm doing.</p>
  
  <p>Trying to access the file through <code>Properties.Settings.Default</code> doesn't work, apparently there's only a ConnectionString resource in my program.</p>
  
  <p>I can't do it in XAML because for whatever reason there's no <code>Source</code> property</p>
  
  <pre><code>&lt;!-- somewhere up the top of App.xaml... --&gt;
  xmlns:clr="clr-namespace:System;assembly=mscorlib"
  
  &lt;clr:String Source="pack://application:,,,/Subfolder/Textfile.txt"/&gt;
  </code></pre>
  
  <p>The FindResource method can't find it either.</p>
  
  <pre><code>FindResource("Usage.txt"); //ResourceReferenceKeyNotFoundException
  </code></pre>
  
  <p>All I'm trying to do is reference the text file, read it as a string and use that string. Otherwise I have to embed a 50 line verbatim string in the method call. Because that's totally a good idea. /s</p>
  
  <p>In WinForms it was as simple as: <code>Properties.Settings.Default.TextFile.ToString();</code> but nothing seems to work here.</p>
  
  <p>I should point as well that this file shouldn't be included in the output directory, it needs to be embedded in the application or whatever the term is.</p>
  
  <p>How should I be doing this?</p>