Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing upgrade-assistant tool #263

Closed
skeeler opened this issue Feb 25, 2021 · 7 comments · Fixed by #291
Closed

Error installing upgrade-assistant tool #263

skeeler opened this issue Feb 25, 2021 · 7 comments · Fixed by #291
Assignees

Comments

@skeeler
Copy link

skeeler commented Feb 25, 2021

Problem encountered on https://dotnet.microsoft.com/platform/upgrade-assistant/tutorial/install-try-convert
Operating System: windows

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

Tried following the instructions to install the upgrade-assistant (preview) tool. Similar error occurs when installing "upgrade-assistant" as when following the steps and installing "try-convert" (below). Error message is not sufficiently clear on what the issue is. Ran the following command, with error output:

PS C:\Users\uname\temp> dotnet tool install -g try-convert
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : Unable to load the service index for source h
ttps://pkgs.dev.azure.com/devopsincanada/demo-public/_packaging/packages/nuget/v3/index.json. [C:\Users\uname
\AppData\Local\Temp\cgl2btwm.mju\restore.csproj]
C:\Program Files\dotnet\sdk\5.0.103\NuGet.targets(131,5): error : Response status code does not indicate succ
ess: 401 (Unauthorized). [C:\Users\uname\AppData\Local\Temp\cgl2btwm.mju\restore.csproj]
The tool package could not be restored.
Tool 'try-convert' 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.

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

@skeeler
Copy link
Author

skeeler commented Feb 26, 2021

@cathysull , if it helps at all, the Azure DevOps project it's referencing no longer exists (I deleted it sometime over the past month). I went looking in the named directories in my local file system. E.g. the "NuGet.targets" file has a disclaimer at the top warning me about editing it directly, so it's not really clear how to flush or otherwise detach this dependency on a "no longer existing" Azure DevOps project. And I'm not even sure what the dependency is or how it got there.

@mtaylorfsmb
Copy link

I have the same issue with try-convert not installing.

@mjrousos
Copy link
Member

mjrousos commented Mar 2, 2021

@skeeler, .NET CLI tools are installed as NuGet packages. It looks like you have NuGet configuration that is adding an authenticated NuGet feed (it lists the URL in the error message) and install is failing because it's trying to restore from that feed without credentials.

Can you aren't installing from a location subject to a NuGet.config file and that NuGet's configuration isn't listing any authenticated feeds and try again?

@skeeler
Copy link
Author

skeeler commented Mar 2, 2021

@mjrousos , thanks for the doc link to the NuGet config file locations. The nuget.exe command-line didn't help (i.e. nuget.exe config), but I was able to find the orphaned package reference in %appdata%\NuGet\nuget.config, remove it by editing the config file, re-ran the "dotnet tool install -g upgrade-assistant" command, and it worked!

@skeeler skeeler closed this as completed Mar 2, 2021
@skeeler
Copy link
Author

skeeler commented Mar 2, 2021

Closing as issue is resolved with @mjrousos assistance. Thank you.

@CoolDadTx
Copy link

@mrjrousos, this is a common scenario, having an authenticated feed, and I don't believe changing the nuget config file is the correct solution (because you have to remember to change it back). Supposedly the issue with dotnet has been fixed in newer versions to support authenticated feeds but there is mixed results.

I think the instructions should be updated to perhaps mention authenticated feed scenarios with the recommendation to use the --ignore-failed-sources flag during installation. This will cause authenticated sources to be skipped if they fail.

@mjrousos
Copy link
Member

mjrousos commented Mar 2, 2021

Good suggestion, @CoolDadTx. I'll add that to the docs.

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

Successfully merging a pull request may close this issue.

5 participants