EF5 Getting this error message: Model compatibility cannot be checked because the database does not contain model metadata

I found the code working by changing

static LaundryShopContext()
{
  Database.SetInitializer<LaundryShopContext>(
    new DropCreateDatabaseIfModelChanges<LaundryShopContext>());
}

into

static LaundryShopContext()
{
  Database.SetInitializer<LaundryShopContext>(
    new DropCreateDatabaseAlways<LaundryShopContext>());
}

Leave a Comment