I have 2 projects in my solution, I have a project with Entity Framework Core installed:
And in the other ASP.NET Web API project I have these packages:
I had the same issue while I had more than one project in the solution. the mistake I was doing was I had not selected the concerned project as the Default project in Package Manager Console. So check if you have selected the same project as default in Package Manager Console in which you want to run migration command.