2011-04-22 25 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表。

相關問題