title: How do I reference classes in a T4 text template that already exist in the current project?
body: <p>I'm trying to use the T4 template to auto-generate some code use in my project.  I started small to get my 'feet wet' and this is what I have so far.</p>
  
  <pre><code>&lt;#@ template debug="false" hostspecific="true" language="C#" #&gt;
  &lt;#@ output extension=".cs" #&gt;
  &lt;#@ assembly name="C:\Users\username\Documents\Visual Studio 2012\Projects\MyProjectSolution\MyProject\bin\Debug\MyProject.exe" #&gt;
  namespace KY_ADJRATE_CLAIM
  {
      public class OutboundClaim
      {
  &lt;#
      ClaimConfig cc;
   #&gt;
      }
  }
  </code></pre>
  
  <p>I've tried this</p>
  
  <pre><code>&lt;#@ assembly name="C:\Users\username\Documents\Visual Studio 2012\Projects\MyProjectSolution\MyProject\bin\Debug\MyProject.exe" #&gt;
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>&lt;#@ assembly name="MyProject.exe" #&gt;
  </code></pre>
  
  <p>But everytime I try to create an instance of one of my classes, I get this:</p>
  
  <p>A namespace cannot directly contain members such as fields or methods.
  Compiling transformation: The type or namespace name 'ClaimConfig' could not be found (are you missing a using directive or an assembly reference?)</p>
  
  <p>What I want to do is access the ClaimConfig class in my project through a T4 template.</p>
  
  <p>Any help would be greatly appreciated.</p>