Error – The model backing the ‘tableServiceContext’ context has changed since the database was created. Consider using Code First Migrations to update the database
I’ve been beating Azure Mobile Services up for a while now. I have to say the product demoed well and the code samples looked pretty straight forward. After digging beyond the basic lit and branching into a project more useful than the ToDoItem demo.
So, this error basically means there’s a mismatch between the stored data schema and the application data schema. “Ya daterbase don’t match yer application”. You fix this problem by either, “using Code First Migration”, here’s a link on how to implement Code First Migration. This will only take you a week of evenings to figure out. Alternatively, you could do as I did twice and completely delete your Azure Mobile Service instance and associated content, that takes about an hour.
Or you can, from Visual Studio, go to Server Explorer, Go to Data Connections, MS_TableConnectionString (ProjectName), Tables and delete all the tables. Don’t forget to delete __MigrationHistory as well. Next time you F5 your solution it will build all new tables and the error will go away.