Running into an issue when trying to set up my first migration. I am using EF 3.1.1, I have a layer for data which is SunshineCoffee.Data and another layer for Web which is SunshineCoffee.Web. The migrations will update a PostgreSQL database.
I run the following command:
dotnet ef --startup-project ../SunshineCoffee.Web migrations add InitialMigration
and receive the following error:
**Could not execute because the specified command or file was not found. Possible reasons for this include:
- You misspelled a built-in dotnet command.
- You intended to execute a .NET Core program, but dotnet-ef does not exist.
- You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.**
Here is my CSPROJ file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SunshineCoffee.Data\SunshineCoffee.Data.csproj" />
</ItemGroup>
</Project>