Entity Framework Code First Error: The model backing the … context has changed …

The other day I received an error “System.InvalidOperationException was unhandled”

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

It turns out that I upgraded Entity Framework packages in only some of the projects within the solution and missed one project.

After I upgraded to the Entity Framework package to the latest one for that project, the error is fixed.

Lesson Learned: if you are going to upgrade one project’s Entity Framework NuGet Packages, be sure to verify all the NuGet packages in ALL of your solution projects have the latest Entity Framework package as well.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s