title: T4 engine not recognizing current project namespace
body: <p>I am using VS 2010 (C#) T4 templates to generate code.</p>
  
  <p>I need to iterate through all types within my project, shortlist entity poco classes and generate wrappers. The problem is, the project namespace is not being recognized.</p>
  
  <p>Here is the solution structure:</p>
  
  <pre><code>namespace MySolution.Entities
  {
      public class Employee { ... }
      public class Department { ... }
  }
  
  // Seperate project referenceing MySolution.Entities.
  namespace MySolution.Database
  {
      public partial class Context { ... }
  
      // Should generate Context.cs as a partial class with after iterating Syste.Types available in MySolution.Entities.
      Context.tt
  }
  </code></pre>
  
  <p>Here is the text template:</p>
  
  <pre><code>&lt;#@ template language="C#" #&gt;
  &lt;#@ Output Extension=".cs" #&gt;
  
  namespace MySolution.Database
  {
      public partial class Context:
          System.Data.Entity.DbContext
      {
  &lt;#
  System.Type [] types = typeof(MySolution.Entities).Assembly.GetTypes();
  for (int i=0; i &lt; types.Count; i++)
  #&gt;
          public &lt;#= types[i].Name; #&gt; &lt;#= types[i].Name; #&gt; { get; set; }
      }
  }
  </code></pre>
  
  <p>The above code generates an error: The type or namespace 'MySolution' cannot be found. Are you missing a using directive or an assembly reference? I then put the following line of code to include the assembly:</p>
  
  <pre><code>&lt;#@ Assembly Name="..\MySolution.Entities\bin\x86\Release\MySolution.Entities.dll" #&gt;
  </code></pre>
  
  <p>Now it gives me a different error: The host threw an exception while trying to resolve the assembly reference '..\..\..TrafficMonitor.Core\bin\x86\Release\TrafficMonitor.Library.dll'. The transformation will not be run. The following Exception was thrown:
  System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)</p>
  
  <p>Any ideas on how to overcome this limitation?</p>