Skip to content

Instantly share code, notes, and snippets.

@ddieppa
Created May 17, 2022 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddieppa/538bb38da543bbd356234023cb84e1be to your computer and use it in GitHub Desktop.
Save ddieppa/538bb38da543bbd356234023cb84e1be to your computer and use it in GitHub Desktop.

Error Installing dotnet tools in the cli

The Error

I was trying to install dotnet EF tools and got this error:

PS C:\juniper\test\Orders.EfPoc> dotnet tool install --global dotnet-ef
C:\Users\ddieppa\AppData\Local\Temp\mu2fjtmo.dfa\restore.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/repzio/729f155b-9685-408c-af3d-87fe3992cafa/_packaging/imcdi/nuget/v3/index.json.
The tool package could not be restored.


* 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.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

Causes

This error cause is because in my Nuget.Config file I have a private feed that requires user and password, then it fails and does not allows me to continue to the next source The Nuget.Config file is normally located at %appdata%\NuGet\NuGet.Config

Solution

Just ignore the source failing and continue to the next ones

PS C:\juniper\test\Orders.EfPoc> dotnet tool install --global dotnet-ef --ignore-failed-sources

References

NuGet feed can't be accessed Where is NuGet.Config file located in Visual Studio project? Common NuGet configurations nuget.config reference Using Package Management Format in Rider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment