2013-11-15 30 views
2

我對Entity進行了一些更改,並且我在packageManager控制檯中成功執行了「update-database -verbose」,並且可以看到反映在azure數據庫中的更改。自創建數據庫以來,支持'myDBContext'上下文的模型已更改。考慮使用代碼優先遷移來更新數據庫

然後我做了部署Azure雲,我正從Azure雲

"The model backing the 'myDBContext' context has changed since the database was created. Consider using Code First Migrations to update the database" 

我試過錯誤消息設置Configuration.AutoDetectChangesEnabled = false,並重新部署

但是還是我得到同樣的錯誤。

請幫助..

+0

可能重複:模型的支持上下文已經改變,因爲數據庫被創建](http://stackoverflow.com/questions/3552000/entity-framework-code-only-error-the-model-backing-the-context-has-changed-sinc) –

回答

8

我由內而外的Global.asax.cs加入

Database.SetInitializer<MyContext>(null);到的Application_Start()解決了這個問題

[唯一實體框架代碼錯誤
相關問題