Been playing around with the Code First feature of Entity Framework 4.1 using an ASP.NET MVC 3 project.
However the database (SQL Server 2008 R2) does not automatically
I have the same issue and found a elegant solution: call the SetInitializer in the constructor of your DbContext:
public class MyDbContext : DbContext { protected MyDbContext : this("MyConnection") { Database.SetInitializer(new CreateDatabaseIfNotExists()); } }
My app setting: