The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or operable program

Dung Do Tien Dec 28 2020 70

I'm getting started with ASP.NET Core 3.1 and EntityFrameworkCore 3.1 also

I have installed some EF Core Nuget package but when trying to create a database by using Migration. I get the message bellow

 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.
At line:1 char:1
+ Add-Migration InitialDatabase
+ ~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I don't know what is happens.

Have 1 answer(s) found.
  • Maybe you have some mistakes when installing EFCore Nuget Packages.

    Can you try to install package Microsoft.EntityFrameworkCore.Tools and try it again

    Milan cubes Dec 28 2020
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips