How to fix The model backing the context has changed since the database was created error

by Steve French in Uncategorized on August 22, 2012

The Problem

You are coding away, and you get the following error

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

This is my most frequent error when programming with Entity Framework asp.net .net mvc.  I usually only happens when using databases I do not have control over.

The Cause

Read this very good page for more info.

The Solution

Just add in this bit of code to your Application_Start() in Global.asax

Database.SetInitializer<MyContext>(null);

And you’re all set.