title: Why am I getting compilation errors in a new MVC4 project?
body: <p>I haven't been able to find an answer to this and have been scouring the internet all weekend, so I was hoping maybe you could help me out with this.</p>
  
  <p>When using Visual Studio 2012, I create a new MVC4 Web Application Project and get some compilation errors.</p>
  
  <p>Here is my problem:</p>
  
  <ol>
  <li><p>I create a new MVC4 Web Application using Visual Studio 2012, I select Internet Application and set it to use RAZOR Engine.</p></li>
  <li><p>I go to Application Properties and under the Application Tab I change Target Framework from .NET Framework 4.5 to .NET Framework 4.</p></li>
  <li><p>The build produces the following errors:</p>
  
  <blockquote>
    <p>Error 1   The type name 'TableAttribute' could not be found. This type has been forwarded to assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.   c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 21  6   MvcApplication1</p>
    
    <p>Error 2   The type or namespace name 'Table' could not be found (are you missing a using directive or an assembly reference?) c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 21  6   MvcApplication1</p>
    
    <p>Error 3   The type or namespace name 'DatabaseGeneratedAttributeAttribute' could not be found (are you missing a using directive or an assembly reference?)   c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 25  10  MvcApplication1</p>
    
    <p>Error 4   The type name 'DatabaseGeneratedAttribute' could not be found. This type has been forwarded to assembly 'System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Consider adding a reference to that assembly.   c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 25  10  MvcApplication1</p>
    
    <p>Error 5   The type or namespace name 'CompareAttribute' could not be found (are you missing a using directive or an assembly reference?)  c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 54  10  MvcApplication1</p>
    
    <p>Error 6   The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?)   c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 54  10  MvcApplication1</p>
    
    <p>Error 7   The type or namespace name 'CompareAttribute' could not be found (are you missing a using directive or an assembly reference?)  c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 87  10  MvcApplication1</p>
    
    <p>Error 8   The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?)   c:\users\saad\documents\visual studio 2012\Projects\MvcApplication1\MvcApplication1\Models\AccountModels.cs 87  10  MvcApplication1</p>
  </blockquote></li>
  </ol>