I have gotten myself into an odd Groundhog Day scenario with an MVC application of mine.
Unless I apply my workaround (Later in this question) each time I debug the application I'm presented with this error:
The model backing the 'UsersContext' 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 have not changed the model.
My workaround workflow is:
- Add-Migration WHATEVERNAME (Makes a blank migration)
- Delete this migration.
- Run: Update-Database
- Recompile & Run (Now without error)
Notes:
- The __MigrationHistory hashes of the latest migration match in both script and in the database.
- I have my MVC application & EF project as separate projects.
- I have tried creating an -IgnoreChanges migration, to see if applying this would mitigate the issue. It did not.
This is quite frustrating, how would I solve this issue permanently?
Note: Automatic migrations are not suitable for my scenario.