title: T4 trouble compiling transformation
body: <p>I can't figure this one out. Why doesn't T4 locate the <code>IEnumerable</code> type? I'm using Visual Studio 2010. And I just hope someone knows why?</p>
  
  <pre><code>&lt;#@ template debug="true" hostspecific="false" language="C#" #&gt;
  &lt;#@ assembly name="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  #&gt;
  &lt;#@ import namespace="System" #&gt;
  &lt;#@ import namespace="System.Data" #&gt;
  &lt;#@ import namespace="System.Data.SqlClient" #&gt;
  &lt;#@ output extension=".cs" #&gt;
  public static class Tables
  {
      &lt;#
  
      var q = @"
          SELECT 
              tbl.name 'table', 
              col.name 'column' 
          FROM 
              sys.tables tbl
          INNER JOIN 
              sys.columns col ON col.object_id = tbl.object_id
      ";
  
      // var source = Execute(q);
  
      #&gt;
  }
  &lt;#+
      static IEnumerable Execute(string cmdText)
      {
          using (var conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=t4build;Integrated Security=True;"))
          {
              conn.Open();
  
              var cmd = new SqlCommand(cmdText, conn);
  
              using (var reader = cmd.ExecuteReader())
              {
                  while (reader.Read())
                  {
                  }
              }
          }
      }
  #&gt;
  </code></pre>
  
  <p>Error   2   Compiling transformation: The type or namespace name 'IEnumerable' could not be found (are you missing a using directive or an assembly reference?) c:\Projects\T4BuildApp\T4BuildApp\TextTemplate1.tt  26  9   </p>