Tool 'dotnet-ef' failed to install. dotnet core

PROBLEM:

My .NET SDKs latest version is 5.0.103 but when i try to install the tool dotnet-ef with version 5.0.103 then it shows an error

error NU1100: Unable to resolve 'dotnet-ef (>= 0.0.0)' for 'net5.0'.

error NU1100: Unable to resolve 'dotnet-ef (>= 0.0.0)' for 'net5.0/any'.

The tool package could not be restored.

Tool 'dotnet-ef' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.

* A package by this name was found, but it was not a .NET tool.

* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.

* You mistyped the name of the tool.


Solution  :
Try this command
dotnet nuget list source
output was no nuget source found.
Then i run this command
dotnet nuget add source https://api.nuget.org/v3/index.json -n DefaultNuget
after adding nuget source
dotnet tool install --global dotnet-ef --version 5.0.3

Comments

Popular posts from this blog

Easy Ui Jquery easyui-textbox change onChange event

Provision AWS EC2 Instance and RDS with Terraform, and Deploy Spring Boot App to EC2 Instance via GitHub Action Pipeline

npm install gets stuck at fetchMetadata