title: How to retrieve a text file from the resource file in C# VS.2005
body: <p>I have a html template that I want to retrieve from the resources file in a VS 2005 C# windows form application.</p>
  
  <p>I've created a folder called /html/ within the project, which has one file in it called template.html.</p>
  
  <p>I've added the file to my resources. I see its name just as template, and it's filepath is the fully qualified filename (c:/.../project/html/template.html). It is saved as TEXT rather than binary.</p>
  
  <p>I've tried many methods to extract this file, but each time I get a null returned. What am I missing?</p>
  
  <pre><code>        Type t = GetType();
          Assembly a = Assembly.GetAssembly(t);
          string file = "html.template.html"; // I've tried template and template.html
          string resourceName = String.Concat(t.Namespace, ".", file);
  
          Stream str = a.GetManifestResourceStream(resourceName);
  
          if (str == null) // It fails here - str is always null.
          {
              throw new FileLoadException("Unrecoverable error. Template could not be found");
          }
          StreamReader sr = new StreamReader(str);
          htmlTemplate = sr.ReadToEnd();
  </code></pre>