C# – The term ‘add-migration’ is not recognized as the name of a cmdlet

centity-frameworkvisual studio

So randomly from one day to the next my migrations stopped working. I do add-migration and it says its not being recognized. I'm using PM since this is a asp.net mvc and was working the day before.

add-migration : The term 'add-migration' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.

enter image description here

Best Answer

This isn't exactly the issue the OP is having, but for dotnet core at least, this can also be caused by not having the Microsoft.EntityFrameworkCore.Tools nuget package installed, which is used for the package manager commands in Visual Studio and command line.