2011-04-22 67 views
3

我得到这个错误,当我跑我的MVC3应用:环境已经改变,因为数据库创建

The model backing the 'MoviesDB' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

我使用EF 4.1。请建议解决方案。

+0

[实体框架代码错误:支持上下文的模型自数据库创建以来已更改]的可能重复(http://stackoverflow.com/questions/3552000/entity-framework-code-only-error-the -model - 背最上下文具有改变的sinc函数) – 2014-02-28 09:35:26

回答

9

看起来像是在Movie模型或数据库中添加了条目。确保模式匹配并删除EdmMetadata表。