-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 restore interactive doesn't prompt for DeviceFlow since .NET 6 SDK #22987
Comments
I have started having this issue as well but i am not sure how this has just started, i have had dotnet 6 installed for awhile now and have not had issues.
|
@ThisWholeDev Maybe the NuGets you were restoring before were already in the NuGet cache. Or maybe the session token was already present in the CredentialProvider storage (see https://github.com/microsoft/artifacts-credprovider#session-token-cache-locations). It has an expiration time, so it only does the auth flow from time to time, not always. But yeah, your output looks like something I'm getting too. |
I've had the same issue. As a workaround use the -v diag parameter, at least this worked for me |
Actually, our workaround was similar, even It's as if the default verbosity is |
I'm getting the same issue, thanks @tompazourek for the workaround. |
Any plans to fix this? My team is also getting this problem since upgrading to .NET 6, the |
Just to confirm that the workaround worked for me. Here's what I used: |
Same issue here, used @cervesus workaround Details:
|
Same issue here when trying to gather a NuGet from a private feed. I can confirm that using following command skips the issue: dotnet tool update -g <nuget_name> --interactive --verbosity minimal |
I did not have this issue until I upgraded from dotnet SDK 6.0.301 to 6.0.302 as a part of the Visual Studio 17.2.6 update. The workaround worked for me, thank you. I do have the nuget CLI installed on it's own. So maybe dotnet CLI was using that one, v6.2.0.146, but when I upgraded my dotnet SDK, it reverted back to the packaged nuget CLI, which is v6.2.1.7. |
Same here, total confusion as it is the first time for me that a dotnet command just does do nothing, please fix this. |
Same issue reported here #24220 |
I think I can see in the code why this happens. This bug fix was added #10024 to ensure that it sets verbosity minimal (much like the example above).
however, where the commands are registered, this is set and then overwritten when the verbosity is registered on the next line. Maybe swapping the lines over would work?
This is the same in the Restore and Update |
I've experienced this as well on .NET 7. Running
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool Re-running it with I'm pretty sure something like this is the basis for the issue I'm having with using .NET interactive notebooks in VS Code in that I cannot install the NuGet packages because it cannot authenticate to my private Artifact feeds. |
The bot closed this however any thoughts on my comment which points to what I believe is the issue in the code that is in this code base? |
@baronfel - This looks like a regression in .NET 6 and higher. Would it be possible for someone to take a look? |
I am experiencing the same issue. So bizarre |
@JL03-Yue can you please take a look at this and see if we can get it fixed? We'll likely want to consider servicing this one, so I'd take a look at the 6.0 codebase first and let any fix flow forward. |
I got this error on Dotnet 7.0.400 in Linux (Pop!_OS) with private NuGet feeds. It worked (in 7.0.400) when adding |
this is impacting installation experience of a tool i'm trying to ship now. |
Hi, do you have ETA when it will be fixed? |
Still broken in 7.0.404, and still requires |
Any updates? |
This is completely broken on .NET 8 SDK:
@joperezr @tarekgh @RussKie folks do you happen to know the right folks to tag here? |
AFAIK, @dotnet/nuget-team any thoughts? |
This is the repository for NuGet issues: https://github.com/NuGet/Home/issues/new/choose |
@RussKie, so, the issue has gone after updating Credential Provider plugins via the |
After installing that latest credential provider (and clearing all my NuGets locally) Out project still needs VSBuild to run as it has some left over framework so running it like When I navigate to that URL in the browser. it loads, so the URL is correct and my browser is authenticated to access the feed. |
I can confirm that this is still not working with .NET 8 at the end of March:
I have installed the latest credential provider with the |
@mdpopescu - Regarding #22987 (comment), the |
What I observe is that after doing a "dotnet restore --interactive --verbosity minimal", it shows up "https://microsoft.com/devicelogin" along with authentication code using which I am able to restore the NuGet packages from the private feed successfully. After this when I do "dotnet tool restore --configfile NuGet.config --interactive --verbosity diagnostic", I am seeing that out of multiple tools mentioned in "dotnet-tools.json" file, one of the tool did get restored correctly but after that it failed to restore rest of the tools and shows the "Response code does not indicate success: 401" error |
@srikcgaa2 - Are you using a "public upstream source" in Azure DevOps/Azure Artifacts by any chance? See https://learn.microsoft.com/en-us/azure/devops/artifacts/how-to/public-feeds-upstream-sources?view=azure-devops&tabs=nuget#q-im-trying-to-restore-my-packages-but-i-keep-getting-a-401-unauthorized-error |
Describe the bug
If I use .NET 5 SDK, and call
dotnet tool restore --interactive
, I get presented with the DeviceFlow authentication flow from NuGet's MicrosoftCredentialProvider plugin (https://github.com/microsoft/artifacts-credprovider).I get something like this:
However, if I need the same thing in .NET 6 SDK (using 6.0.100), the output is silent, I don't receive any prompt on the output.
I found a workaround to add
--verbosity minimal
in the command parameters. But without this, it seems that the default verbosity isquiet
which doesn't include the interactive auth flow prompt.In .NET 5, the verbosity switch didn't have any effect for
dotnet tool restore
, I even created issue #16535. but in .NET 6, suddenly, the verbosity is working. It's just that the default verbosity is too quiet and is missing the important prompts.To Reproduce
dotnet tool restore --interactive
Further technical details
The text was updated successfully, but these errors were encountered: