Question

I followed this tutorial

And then did

Update-Database -Force -Verbose

It showed that it upgraded the table. However an error is shown:

The model backing the 'DbConnection' context has changed 
since the database was created.
Consider using Code First Migrations to update the database
(http://go.microsoft.com/fwlink/?LinkId=238269).

I also tried

Enable-Migrations -ContextTypeName MvcApplication6.Models.DbConnection

However it says:

Migrations have already been enabled in project 'MvcApplication6'. 
To overwrite the existing migrations configuration, use the -Force parameter.

Any ideas what I did wrong?

Accepted Answer

I found the solution here.

Database.SetInitializer<DbConnection>(null);



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why