dotnet new -i templates --nuget-source does not support --interactive auth
See original GitHub issueHi,
dotnet sdk version 3.1.100
Attempting to install dotnet CLI templates from a secured Azure Artifacts NuGet repository does not seem to be working. The command correctly outputs that an --interactive authentication flow may be required. However, the dotnet new -i command does not actually support the --interactive flag.
Using the same repository, csproj dependencies can be restored via the CLI. See below for command output.
dotnet new -i Test.Templates --nuget-source https://privatesource.pkgs.visualstudio.com/_packaging/Test/nuget/v3/index.json
C:\Program Files\dotnet\sdk\3.1.100\NuGet.targets(123,5): warning : The plugin credential provider could not acquire credentials. Authentication may require manual action. Consider re-running the command with --interactive for `dotnet`, /p:NuGetInteractive="true" for MSBuild or removing the -NonInteractive switch for `NuGet` [C:\Users\Greg\.templateengine\dotnetcli\v3.1.100\scratch\restore.csproj]
C:\Program Files\dotnet\sdk\3.1.100\NuGet.targets(123,5): error : Unable to load the service index for source https://privatesource.pkgs.visualstudio.com/_packaging/Test/nuget/v3/index.json. [C:\Users\Greg\.templateengine\dotnetcli\v3.1.100\scratch\restore.csproj]
C:\Program Files\dotnet\sdk\3.1.100\NuGet.targets(123,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\Greg\.templateengine\dotnetcli\v3.1.100\scratch\restore.csproj]
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
dotnet new install - .NET CLI
The dotnet new install command installs a template package. ... If --nuget-source is specified, the source will be added to the list of ......
Read more >Installing dotnet new template not working from NuGet ...
I have a template which is packaged and deployed to an Azure Devops NuGet Feed. I can't install this template when I use...
Read more >How to Create Your .NET Project Template
This article will focus on project templates, that is, templates that allow you to create a new project with specific features. While in...
Read more >Dotnet restore vs nuget restore. Share. In my code repo, there
We tried upgrading the NuGet version but it did not help. exe to the windows path ... Running dotnet restore --interactive should prompt...
Read more >How to send .Net Core NuGet packages to Azure Artifacts
Without this parameter, the command won't work. dotnet nuget push .\bin\Debug\NugetPackage.1.0.0.nupkg --source "MeuFeed" --api-key teste --interactive.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vlada-shubina Thanks, installing the artifacts-credprovider with the command
iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) }"
followed bydotnet new -i <package name> --nuget-source <Azure Artifacts package source> --interactive
works.You may close the issue now.
@viliket
Until .NET 6 Preview 4
dotnet new
was runningdotnet restore
to install the packages, that’s why #2276 mentions it. To use--interactive
flag, you still need to install credential provider, as mentioned in #1747 (first 2 steps, without -netfx option)I’ve tested it on 5.0.201, and it works for me - see below:
I need more information to see what might be wrong for your case. Could you please try to run
dotnet restore <csproj> --source <your source> --packages .\ --interactive
for the csproj file shim attached and check if it is successful? In csproj shim please replace placeholders with name and version of the package you are trying to install.This will be exactly the same action
dotnet new
is running to install the packages, but might give more information on the errors, especially in verbose mode.Thanks. shim.zip
(I will keep issue open to receive notifications)