I have a project I have written in ASP.NET core since the beta days. Always upgraded to later version and was able to run migrations with migrations command package manager consoler.
However latest Visual Studio 2017 Update 2 migrations commands in package console are no longer recognized.
If I run the command in Package Manager Console
The term 'add-migration' is not recognized as the name of a cmdlet, function, script file, or operable program
I upgraded from Visual Studio 2017 Update 1 and one of my packages in my class library csproj
Microsoft.EntityFrameworkCore.Tools seem to have been upgraded from 1.1.0 to 1.1.1 which seems to have caused migration commands to not be recognized. To try resolve this I changed Tools back to 1.1.0 back but still the migrations powershell commmands don't work.
I am using the powershell commands and not the dotnet ef commands which aren't supported in a class library.
- adding/removing packages
Microsoft.EntityFrameworkCore.Tools.DotNet and to my csproj and
Microsoft.EntityFrameworkCore.Tools reopening closing Visual Studio in between.
- running dotnet restore
- running the correspondingcsproj version nuget ef toold init.ps1 in package manager console
I have tried all the stackoverflow answers. Nothing works
I resolved it by
dotnet restoreon all my projects
add-migrationcommand in package manager console with my class library the Default project and it gets recognized