Unable to generate an explicit migration in entity framework

后端 未结 28 1222
情书的邮戳
情书的邮戳 2020-12-12 23:31

I am adding a new migration but this message shows:

Unable to generate an explicit migration because the following explicit migrations are pending:

28条回答
  •  有刺的猬
    2020-12-12 23:49

    This error can also mean that the migrations are not recognized anymore. This happened to me after having changed the value of the ContextKey in Migrations.Configuration. The solution was simply to update the ContextKey in the database table "__MigrationHistory" (or revert the value in the Configuration class I guess). The ContextKey and the Namespace in your application should match.

提交回复
热议问题