title: Can not use my custom class in T4 template
body: <p>I have researched google and SO and can not find answer. </p>
  
  <p>I have looked at following post with out any success. </p>
  
  <p><a href="https://stackoverflow.com/questions/11078905/use-class-inside-a-t4-template">Use class inside a T4 template</a></p>
  
  <p>In my T4 template, I am trying to use AddControls Method defined in my Custom class ResourceManager but I am getting the following error. </p>
  
  <p><strong>Compiling transformation: The type or namespace name 'WebApplication1' could not be found (are you missing a using directive or an assembly reference?)</strong> </p>
  
  <p><em>Please help me.</em></p>
  
  <pre><code>namespace WebApplication1
  {
      public static class ResourceManager
      {
  
          public static void AddControls(List&lt;string&gt; controlList)
          {
              controlList.Add("Label1");
              controlList.Add("Button1");
          }
       }
  }
  </code></pre>
  
  <p>My T4 Template code looks as follows:</p>
  
  <pre><code>&lt;#@ template debug="false" hostspecific="true" language="C#" #&gt;
  &lt;#@ output extension=".txt" #&gt;
  
  &lt;#@ assembly name="$(TargetPath)" #&gt;
  &lt;#@ import namespace="WebApplication1" #&gt;
  &lt;#@ import namespace="System.Collections.Generic" #&gt;
  
  
  &lt;#
      List&lt;String&gt; controlList = new List&lt;String&gt;();
  
      ResourceManager.AddControls(controlList);
  
      foreach (string str in controlList)
      {
  
          string propName= str;
  #&gt;
      My control is  &lt;#=            propName #&gt;
  
  &lt;#
      }
  
  #&gt;
  </code></pre>