I am adding a new migration but this message shows:
Unable to generate an explicit migration because the following explicit migrations are pending:
Had the same issue and was able to solve with some hints from above answers:
Use "update-database -verbose" in the package manager console to get more specific information where migrations tries to connect to. (Helped in my case to find out my startup proj was not set correctly...)
This isn't going to be the answer for many people, but EF will chuck this error when it can't connect to the DB. If you're working from home like I am, make sure you're still connected to your VPN!
That was happened when i suddenly renamed class of old migration that already exist in db. I checked VCS history, determined that and renamed back. All worked afterwards.
I did another way. I droped database entirely and run "update-database" again in vs.