2013-04-28 134 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);