【问题标题】:Code First Migration failing代码优先迁移失败
【发布时间】:2013-04-28 15:04:35
【问题描述】:

我关注了这个tutorial

然后做了

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.

任何想法我做错了什么?

【问题讨论】:

    标签: asp.net-mvc-4 entity-framework-migrations entity-framework-6


    【解决方案1】:

    我找到了解决方案here

    Database.SetInitializer<DbConnection>(null);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-04
      • 1970-01-01
      • 1970-01-01
      • 2016-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多