title: Files in WindowsPhone Silverlight using ---- var resource = Application.GetResourceStream
body: <p>I am new to Windows Phone and Silverlight. I am in the process of completing two phone apps in C#. However I have an issue with files for windows phone. Whenever I search google for information on files with Silverlight for windows phone I come across the same code I have been using. Whenever I run these lines of code:</p>
  
  <pre><code>var resource = Application.GetResourceStream(new Uri("dictionary.txt", UriKind.Relative));
  dictionary = new StreamReader(resource.Stream);
  </code></pre>
  
  <p><code>resource</code> is always <code>null</code> and therefore my apps crash. <code>dictionary</code> is declared as a <code>StreamReader</code> and I have placed my text file in the same location as <code>MainPage.xaml.cs</code> (C# source file). Could somebody please point out my error? </p>