Reputation: 77
I am using Visual Studio for Mac and have .NET Core 2.1 project. I have an issue when using any migration command like "Add-Migration", namely the following error occurs:
**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 DBUpdates -Context applicationdbcontext
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException**
Any clue what the cause of this could be?
Upvotes: 0
Views: 811
Reputation: 636
You might be missing the nuget package, if thats not the case also double check you have the powershell interface in Visual Studio pointing at the correct project (You want the one where your DbContext object exists and is defined)
Upvotes: 0
Reputation: 5031
This error indicates that one package is missing.
Install package Microsoft.EntityFrameworkCore.Tools
from nuget. Then reopen the visual studio.
Upvotes: 3