I ran into this error “Unable to generate an explicit migration because the following explicit migrations are pending”.
Common causes include:
- You really have some pending migrations. You can do “update-database –verbose” to apply the pending migrations.
- Your solution have multiple projects (e.g. WebAppProject, DataModelProject) and the wrong project is set as the start up project. So just go to Visual Studio and select the right project and then set it as a startup project.
- You changed the ContextKey value in the Migrations\Configuration.cs. You can always check the [dbo].[__MigrationHistory] entries to see if the ContextKeys match. If Configuration.cs does not have a ContextKey, that should be fine.