title: ADO.NET Self-Tracking Entity Generator compile errors
body: <p>I can't figure out why I suddenly get these compile errors. Let's go through the steps I take:</p>
  
  <p>1) I create a new MVC3 ASP.NET project (C#) using the Razor View engine</p>
  
  <p>2) In my Models folder, I add an ADO.NET Entity Data Model, connect it to my database, and name it Database.edmx</p>
  
  <p>3) I open my Database.edmx and select Add code generation item. I then add a Selft-Tracking Entity Generator and call it Model.tt</p>
  
  <p>Everything is automaticly generated. When I hit build however, I get following compile errors:</p>
  
  <pre><code>Error   1   Cannot implicitly convert type 'System.Type' to 'MyOwnProject.Models.Type'  
  Error   2   'MyOwnProject.Models.Type' does not contain a definition for 'IsValueType' and no extension method 'IsValueType' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?) 
  Error   3   'MyOwnProject.Models.Type' does not contain a definition for 'IsGenericType' and no extension method 'IsGenericType' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?) 
  Error   4   'MyOwnProject.Models.Type' does not contain a definition for 'GetGenericTypeDefinition' and no extension method 'GetGenericTypeDefinition' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)   
  Error   5   Cannot implicitly convert type 'System.Type' to 'MyOwnProject.Models.Type'  
  Error   6   'MyOwnProject.Models.Type' does not contain a definition for 'FullName' and no extension method 'FullName' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)   
  Error   7   'MyOwnProject.Models.Type' does not contain a definition for 'FullName' and no extension method 'FullName' accepting a first argument of type 'MyOwnProject.Models.Type' could be found (are you missing a using directive or an assembly reference?)   
  </code></pre>
  
  <p>To me, this makes no sense at all. I've created new projects with a database this way a dozen times and now, all of a sudden, I get these compile errors. It doesn't make a difference what I name the database, edmx or models. It also makes no difference wether the database sits in the App_Data folder, or on an external location on my hard drive.</p>
  
  <p>Does anyone have any idea why this is failing? Thanks.</p>