Model compatibility exception in Entity Framework

code-first, entity-framework

Solution

Using migrations isn't really necessary if you're developing on your local machine. You can just set the database Initializer to drop the database always, run some code that interacts with the database, and then you'll see that the database will be recreated and the error will be gone.

Should work, that's how I do it.

Problem

When I execute my web app and try to save data into databse, this exception happens : Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations. I try lot of issue for resolve this problem , but it persist yet !!

Original source