If I run dotnet ef add testmigration
I get this warning: The EF Core tools version \'2.1.0-rtm-30799\' is older than that of the runtime \'2.1.1-r
Ok.
Turns out that this is caused by having the second latest sdk installed (2.1.301), but somewhere in the path a global.json pinned to version 2.1.300.
This error is also shown when you select a different project on Package Manager Console rather than the Entity Framework
project in your solution.
install-package Microsoft.EntityFrameworkCore.Tools -Version 2.1.8
did it for me
I was having this exact problem. I tried deleting bin folders and rebuilding as others have suggested but that never worked. Finally I updated the SDK to 2.1.403 and the issue was resolved.