The term ‘dotnet-ef’ is not recognized – Entity Framework error

Quick post about fixing Entity Framework, probably common error when you want to use ef for the first time e.g. you installed Visual Studio on new pc, fresh os, new project etc. and want to make dotnet-ef migrations or database update.

Error message:
“dotnet-ef : The term ‘dotnet-ef’ 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.”

Fix, you could run this command in Package Manager Console:

dotnet tool install --global dotnet-ef

Or you can install Microsoft.EntityFrameworkCore.Tools package from NuGet Package Manager.

Sample success message after use above command:
“You can invoke the tool using the following command: dotnet-ef
Tool ‘dotnet-ef’ (version ‘5.0.8’) was successfully installed.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: