Q:
当我输入add-Migration Chap5命令后,返回错误如下: Unable to generate an explicit
migration because the following explicit migrations are pending:
[201312260629440_InitialCreate]. Apply the pending explicit migrations
before attempting to generate a new explicit migration. 请问这个问题怎么解决
A:
这是存在悬挂的migration,可以尝试在[201312260629440_InitialCreate] 中把 public override void Up() 方法中的操作全注释后再运行一次update-database,就是什么也不做,单纯执行完悬挂的migration。
之后再执行你需要的add-Migration操作