dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.27k stars 5.9k forks source link

command "dotnet tool install -g mlnet" is not working #12263

Closed myusrn closed 5 years ago

myusrn commented 5 years ago

I execute the command "> dotnet tool update -g mlnet" and it produces the following output. If this is just expected to work as the page suggests then it would seem a dependency or command parameter, e.g. --version #.#.# , is missing from the instructions.

d:\src\repos>dotnet --list-sdks
2.1.602 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]

d:\src\repos>dotnet tool install -g mlnet
C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\NuGet.targets(119,5): error : Unable to load the service index for source https://pkgs.dev.azure.com/myusrn/_packaging/myfeed/nuget/v3/index.json. [d:\src\temp\z0qccm5x.r1m\restore.csproj]
C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\NuGet.targets(119,5): error :   Response status code does not indicate success: 401 (Unauthorized). [d:\src\temp\z0qccm5x.r1m\restore.csproj]
The tool package could not be restored.
Tool 'mlnet' 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.

d:\src\repos>

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

JRAlexander commented 5 years ago

Hi, @myusrn. The prerequisites state that .NET Core 2.2 SDK is needed for this tool. Retry it with 2.2 instead of 3.0 preview and you should be good to go. Closing as this issue is resolved. Thanks!

myusrn commented 5 years ago

Thanks for details. Is there a way to tell dotnet tool install -g mlnet command to use the 2.2 sdk versus the vs19 installed 3.0.100-preview# sdk versus having to uninstall it?

JRAlexander commented 5 years ago

Try dotnet tool update -g mlnet --framework netcoreapp2.2

myusrn commented 5 years ago

Thanks for those details. Doing more testing the issue was not arising from the presence of the vs19 installed dotnet core 3.0.100-preview sdk. It was a result of the 401 accessed denied arising when the dotnet tool install/update . . . command attempted to iterate through my set of defined nuget feeds and hit the one pointing at my azure devops nuget package feed where it appears there are no cached credentials in place. I used vs19 | tools | options | nuget pacakage manager | package sources UI to uncheck/disable that package feed and after that the dotnet tool install/update -g mlnet command to succeed with dotnet core 3.0 sdk preview installed.