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

Dotnet Tool Install should support --interactive #9881

Closed
JCanlett opened this issue Oct 24, 2018 · 13 comments · Fixed by dotnet/cli#10524
Closed

Dotnet Tool Install should support --interactive #9881

JCanlett opened this issue Oct 24, 2018 · 13 comments · Fixed by dotnet/cli#10524
Assignees
Labels
Milestone

Comments

@JCanlett
Copy link

Steps to reproduce

Using a private feed, run dotnet tool install -g --interactive

Expected behavior

dotnet tool install passes the interactive flag to dotnet restore during the installation to support authentication

Actual behavior

dotnet tool fails with unknown command --interactive

Honestly feel the entire auth workflow needs some attention when dealing with Azure DevOps feeds. Currently the only working flow to get this to install is this:

  1. dotnet nuget locals -c all
  2. dotnet restore --interactive (this gives me a URL & code to open in a browser to complete auth) ??
  3. dotnet tool install -g <%toolname%>

If I don't clear all nuget cache first, the tool install command doesn't seem to look outside the cache folders and simply fails with a package not found error.

Environment data

dotnet --info output:
.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e1549

Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.403\

Host (useful for support):
Version: 2.1.5
Commit: 290303f510

.NET Core SDKs installed:
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.101 [C:\Program Files\dotnet\sdk]
2.1.102 [C:\Program Files\dotnet\sdk]
2.1.103 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.400 [C:\Program Files\dotnet\sdk]
2.1.401 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.403 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.3-servicing-26724-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

@jonstelly
Copy link

I just ran into this trying to install a global tool. As a workaround I used dotnet add package [PRIVATE_PACKAGE_NAME] --interactive in a throwaway project to authenticate.

Even if adding the package to the throwaway project fails (framework mismatch, etc...), the authentication succeeds and is valid for the global tool install. Something like this in powershell:

$packageId = '[PRIVATE_PACKAGE_NAME]'
push-location;
try {
  cd $env:TMP;
  mkdir fakenugetauth | cd;
  dotnet new classlib;
  dotnet add package $packageId --interactive;
  dotnet tool install -g $packageId;
}finally {
  pop-location;
  rm -recurse "$($env:TMP)/fakenugetauth";
}

@wli3
Copy link

wli3 commented Dec 13, 2018

Add --interactive flag is easy, however, current default nuget restore verbosity is quiet or it will show the confusing temp project path. That means the authentication message won't show and it completely hangs. Need to discuss this issue with nuget next monday

@wli3
Copy link

wli3 commented Dec 18, 2018

NuGet/Home#7647

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Discussion milestone Jan 31, 2020
@304NotModified
Copy link

304NotModified commented Nov 23, 2021

In summary:

add --verbosity minimal (or -v=m)

dotnet tool install -g <toolname> --verbosity minimal

@Balfa
Copy link

Balfa commented Jan 7, 2022

But why was this issue closed? dotnet tool install -g <toolname> --interactive still doesn't work without -v m. How would a user know to add that?

@stevieray8450
Copy link

What in the world? That is not intuitive at all

@blueelvis
Copy link

This should be reopened. :(

@304NotModified
Copy link

@wli3 please reopen, see comments above

@alundgren
Copy link

Just got bitten by this. How indeed would a user know to add -v m. Sat and waited for quite a long time for something to happen before google got me here. Please reopen and fix this.

@AmadeusW
Copy link

Please either reopen this or NuGet/Home#7647, this issue is not fixed with the following configuration:

> dotnet nuget --version
NuGet Command Line
6.4.0.117
> dotnet --version
7.0.100

@asos-stefanzilik
Copy link

Reopen please, --interactive not working with dotnet new --install

@304NotModified
Copy link

I think we need to create a new issue to get any feedback

@ahaleiii
Copy link

I also request that this issue be re-opened. The use of --interactive should automatically set the verbosity to the minimum needed in order to be able to authenticate.

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

Successfully merging a pull request may close this issue.