Alex
Alex

Reputation: 433

How do I resolve a model backing MVC error if I have not made changes to the model backing my DbContext

I just tried to build a project I'm working on after doing a get latest in VS2015. After rebuilding and attempting to launch the project, I'm getting the following:

The model backing the 'DevProjDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database

Nowhere in the project am I finding where the model backing the context has changed since my last get latest yesterday. Has anyone else encountered this error when the underlying model is unchanged?

Upvotes: 0

Views: 58

Answers (2)

Poonam
Poonam

Reputation: 153

If you're not sure of the target migration then better delete the migrationhistory table from your db and migration folder from you solution and re-add migrations to your code.

Upvotes: 1

poppertech
poppertech

Reputation: 1294

To determine the "changes" to your database, use Migrations to generate a script without changing the database.

Update-Database -Script

Upvotes: 0

Related Questions