title: T4 Compiling transformation: The type or namespace name 'Template' could not be found
body: <p>I am trying to generate a Xaml file using Template T4 and defining a reusable file Xaml.tt like this</p>
  
  <pre><code>&lt;#@ template language="C#" hostspecific="True" debug="True" #&gt;    
  &lt;#@ assembly name="System.Xml.dll" #&gt;
  &lt;#@ assembly name="System.Xml.Linq.dll" #&gt;
  &lt;#@ import namespace="System.Xml" #&gt;
  &lt;#@ import namespace="System.Xml.Linq" #&gt;
  &lt;#@ import namespace="System.IO" #&gt;
  &lt;#@ import namespace="System.Collections" #&gt;
  &lt;#@ import namespace="System.Collections.Generic" #&gt;
  &lt;#@ import namespace="Microsoft.VisualStudio.TextTemplating" #&gt;
  &lt;#+
  public class Xaml : Template
  {
      public override string TransformText()
      {
  #&gt; 
          // Xaml Content
  
    &lt;#+
      return this.GenerationEnvironment.ToString();   }
  
      }
     #&gt;
  </code></pre>
  
  <p>But i have an error:  the template namespace couldn't be found, any one has idea about that ? Still same error !! frustrating !!</p>
  
  <p>Error: T4 Compiling transformation: The type or namespace name 'Template' could not be found (are you missing a using directive or an assembly reference ?)</p>
  
  <p>I am getting the same error for Generator.</p>
  
  <p>I created these file by adding new item Code Generation > Template </p>
  
  <p><img src="https://i.stack.imgur.com/6AqJJ.png" alt="How to create the Xaml file"></p>
  
  <p>The default structure of the file is and still not recognizing Template.</p>
  
  <pre><code>&lt;#+
  // &lt;copyright file="Template1.tt" company="HP"&gt;
  //  Copyright © HP. All Rights Reserved.
  // &lt;/copyright&gt;
  
  public class Template1 : Template
  {
  public override string TransformText()
  {
  
      return this.GenerationEnvironment.ToString();
  }
  }
  #&gt;
  </code></pre>
  
  <p>Is the an assembly reference or a directive i am missing ?</p>
  
  <p>BTW i am using T4 Toolbox also</p>