Installing dotnet ef tool

Global tools can be installed in the default directory or in a specific location. The default directories are:

  • Linux/macOS —> $HOME/.dotnet/tools
  • Windows —> %USERPROFILE%\.dotnet\tools

If you’re trying to run a global tool, check that the PATH environment variable on your machine contains the path where you installed the global tool and that the executable is in that path.

Troubleshoot .NET Core tool usage issues

dotnet ef --version

 

 

For everyone using .NET Core CLI on MinGW MSYS:

After installing using

dotnet tool install --global dotnet-ef

add this line to to the bashrc file (C:\msys64\home\username\ – .bashrc (the location depends on your setup)

export PATH=$PATH:/c/Users/username/.dotnet/tool

 

This will work for me on Visual studio code, in Ubuntu

dotnet tool install --global dotnet-ef
dotnet tool restore

After that all the execution are done like

dotnet tool run dotnet-ef

or

dotnet dotnet-ef

 

I solved this problem by installing dotnet-f tool locally with the following commands.

If you are setting up this repository

dotnet new tool-manifest

dotnet tool install --local dotnet-ef --version 5.0.6

 

Create a first EF-Core App

Official guide

https://learn.microsoft.com/en-us/ef/core/get-started/overview/first-app?tabs=netcore-cli

 

Create the database

dotnet tool install --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet ef migrations add InitialCreate
dotnet ef database update

 

 

Was this article helpful?

Related Articles

Leave A Comment?