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

asp.net-mvc-5 entity-framework-6

Question

I'm using CodeFirst migrations with MVC5 and EF6. I'm trying to access the model classes in my MVC web app, but I keep receiving this problem because my model is in a different project. Automatic migrations are already turned on. Even after using update-database to rebuild everything and dropping the entire database, I still receive this error. The context has not changed since I built the database, so the error is incorrect. Additionally, I can reference the same Model project and access the model classes and data through a Unit Test project using the same calling code that I do in my MVC app. I need to be able to utilize the Model outside of the web, thus I keep it distinct from the MVC project.

Since the database's creation, the model supporting the "xx" context has evolved. Consider updating the database using Code First Migrations.

1
6
2/23/2014 8:14:30 PM

Popular Answer

7
2/11/2015 2:29:41 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow