Trying to run an initial migration on an .NET 7 ASP.NET API project, but receiving the error
'add-migration' is not recognized as an internal or external command
I have seen several similar threads on StackOverflow that recommend installing "Microsoft.EntityFrameworkCore.Tools", however this is installed.
I have tried:
Unfortunately not sure where to go from here.
You need to invoke the commands in the Package Manager Console in Visual Studio.
Here is documentation about Package Manager Console.
In your case:
Installing the package for EF Core
Install-Package Microsoft.EntityFrameworkCore.Tools
Verify the installation
Get-Help about_EntityFrameworkCore
Adds a new migration.
Add-Migration Init
If you don't want to use the Package Manager Console and you prefer for example powershell you can use the dotnet ef tool.