EF Core Tools not working on dotnet core 3 preview 4
.NET Core 3.0 introduces Local Tools:
Local tools are similar to global tools but are associated with a particular location on disk. Local tools aren't available globally and are distributed as NuGet packages.
dotnet Core and, also, EF Core, are evolving fast. It's easy to have several projects/solutions at different dotnet versions. With Local Tools you can configure specific version tools by project.
Steps to configure tool by project:
dotnet new tool-manifest
#executing this at sln level (or with your projecte) a new .config file is created
#check lasts versions at:
#https://www.nuget.org/packages/dotnet-ef/
dotnet tool install --local dotnet-ef --version 3.1.4
#this will configure dotnet ef tool
dotnet ef
#should run at this point
At this point your ef migrations/database command must runs.
When people clone your repo should run:
dotnet tool restore
Edit:
At this point dotnet core 3 is no longer preview, so select our version accordingly. (Check version)
First make sure that,
- You're using the .NET Core SDK 3.0 Preview, type
dotnet --info
and see there's a line like,
.NET Core SDKs installed: 3.0.100-preview4-011223 [C:\Program Files\dotnet\sdk]
- You ran
dotnet restore
on the project - You are
cd
ed to the project's (*.csproj) directory
With Entity Framework Core 3.0 Preview 4, dotnet-ef tool is no longer part of the .NET Core SDK. Uninstall the stable version of dotnet-ef
tool (2.2.4 at this point) using,
dotnet tool uninstall --global dotnet-ef
Then install the preview or latest stable, (Check version)
dotnet tool install --global dotnet-ef --version 3.0.0-preview4.19216.3
After that dotnet ef
should work fine.