question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet tool install fails with multiple feeds

See original GitHub issue

From @ppumkin on September 26, 2018 10:20

Issue Title

When I try to install a global tool, for example coverlet I get an error.

If I try any other tool I get the same error

General

The error message is as follows

dotnet tool install --global coverlet.console
C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : Unable to load the service index for source https://private_feed.pkgs.visualstudio.com/_packaging/private_feed/nuget/v3/index.json. [C:\Users\piotr.kula\AppData\Local\Temp\e4hqjeii.vid\restore.csproj]
C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error :   Response status code does not indicate success: 401 (Unauthorized). [C:\Users\piotr.kula\AppData\Local\Temp\e4hqjeii.vid\restore.csproj]
The tool package could not be restored.
Tool 'coverlet.console' 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 Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

The problem is that we use private NuGet feeds from Azure DevOps packages and symbol server.

So two things are happening here.

  1. When access to a source feed fails the entire tool bombs out.
  • Expected to use NEXT source, which would have been NuGet.
  1. Authorisation is not working from the command line
  • Expected authorisation window to show or use credentials Visual Studio has already created

Workaround

  1. In visual studio, Disable the private feed and run the dotnet tool install.
  2. Installs as expected.
  3. Enable private feed after completed

Copied from original issue: dotnet/core#1962

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
wli3commented, Oct 26, 2018

2.2.1xx added option --ignore-failed-sources can be used in this case. This can make workaround easier. https://github.com/dotnet/cli/pull/9830

reg the root cause auth issue. Could you restore a normal project in command line without special nuget.config?

Could you try to use --configfile and pass the path in the nuget.config with auth config?

0reactions
wli3commented, Dec 3, 2019

@sparker2000 maybe you could use --configfile to pass a different config file to use

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot .NET tool usage issues
Tool installation requires access to the NuGet feed that contains the tool package. It fails if the feed isn't available. You can alter...
Read more >
Cannot install anything using dotnet tool install command
it looks like dotnet tool iterates the nuget.config sources and when one fails, it doesn't continue with next ones.
Read more >
Unable to install dotnet tool from private nuget feed
I have a dotnet tool that is published as a Nuget package to a private feed. From a YAML pipeline I would like...
Read more >
Install dotnet global tool with private NuGet feed - Matt DuFeu
In this post I show how to solve a 401 Unauthorised error while installing a .NET Global Tool and you have a private...
Read more >
dotnet-tool-install: Installs the specified .NET tool on ...
The dotnet tool install command provides a way for you to install . ... If the same package and version is in multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found