title: Installed MVC 4 Entity framework configuration errors
body: <p>I have just installed MVC4.</p>
  
  <p>According to nuGet package manager, my version of EF is 5.0.0, last updated on 11th Sept 2012</p>
  
  <p>When I try to create a new controller (right click controllers -> Add -> Controller), I am faced with an error message and am not able to create a new controller...</p>
  
  <pre><code>Could not load type 'System.ComponentModel.DataAnnotations.Schema.TableAttribute' 
  from assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral,     
  PublicKeyToken=b77a5c561934e089'.
  </code></pre>
  
  <p>I am just getting started with ASP.NET MVC, so if anybody could help me to resolve, it would be much appreciated.</p>
  
  <p>From the Package Manager Console, I have tried uninstalling and re-installing Entity Framework as follows but this has had no effect:</p>
  
  <pre><code>PM&gt; Uninstall-Package EntityFramework
  Successfully removed 'EntityFramework 5.0.0' from GD.
  Successfully uninstalled 'EntityFramework 5.0.0'.
  
  PM&gt; Install-Package EntityFramework
  You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&amp;clcid=0x409. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
  Successfully installed 'EntityFramework 5.0.0'.
  Successfully added 'EntityFramework 5.0.0' to GD.
  
  Type 'get-help EntityFramework' to see all available Entity Framework commands.
  
  PM&gt; 
  </code></pre>
  
  <p>Many thanks in advance for all your help.</p>
  
  <p>UPDATE:</p>
  
  <p>I am following this tutorial. <a href="http://msdn.microsoft.com/en-us/data/gg685467.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/data/gg685467.aspx</a></p>
  
  <p>It appears that MVC4 does not like this method of creating a DBContext...</p>
  
  <pre><code>Also there will be a new reference listed in the project references
  called EntityFramework. This is the assembly that contains the Code
  First runtime.
  
  Add a new class to the Models folder and name it BlogContext. Modify
  the class to match the following code: 
  
  using System.Data.Entity;
  namespace MVC3AppCodeFirst.Models 
  {   
      public class BlogContext : DbContext   
      {
          public DbSet&lt;Blog&gt; Blogs { get; set; }
          public DbSet&lt;Post&gt; Posts { get; set; }
          public DbSet&lt;Comment&gt; Comments { get; set; }   
      } 
  }
  </code></pre>
  
  <p>It builds fine, so am I missing something ???</p>