2013-04-28 136 views
0

我跟着這個tutorial的Code First遷移失敗

,然後做

Update-Database -Force -Verbose 

結果表明,它升級了表。 但是顯示錯誤:

The model backing the 'DbConnection' context has changed 
since the database was created. 
Consider using Code First Migrations to update the database 
(http://go.microsoft.com/fwlink/?LinkId=238269). 

我也試過

Enable-Migrations -ContextTypeName MvcApplication6.Models.DbConnection 

但是它說:

Migrations have already been enabled in project 'MvcApplication6'. 
To overwrite the existing migrations configuration, use the -Force parameter. 

任何想法,我做錯了什麼?

回答

0

我找到了解決方案here

Database.SetInitializer<DbConnection>(null);