question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support --interactive for templates behind private nuget feed

See original GitHub issue
  1. For dotnet new -i. To use install a template behind private nuget feed the user cannot specify nuget feed in the command line . The user need to set the nuget feed in the global nuget config.

  2. After adding a private nuget feed, if the feed need auth. The user will see the following error

/Users/williamli/Documents/cli/artifacts/tmp/Debug/dotnet/sdk/3.0.100-preview-009752/NuGet.targets(114,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` [/Users/williamli/.templateengine/dotnetcli/v3.0.100-preview-009752/scratch/restore.csproj]

However, --interactive command is not available for dotnet new

To repro add my private feed to ~/.nuget/NuGet/NuGet.Config

<add key="testingnugetauth" value="https://williamleewul.pkgs.visualstudio.com/_packaging/testingnugetauth/nuget/v3/index.json" />

And run dotnet new -i wul.DotNet.Common.ItemTemplates

  1. If the template uses a private package in another feed. The restore will fail due to no --interactive is passed to subsequence restore.

related to https://github.com/dotnet/templating/issues/1545 but now we have --interactive

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:14
  • Comments:21 (5 by maintainers)

github_iconTop GitHub Comments

8reactions
allysonjosescommented, Oct 4, 2019

Any update on this issue?

7reactions
Boruc04commented, Apr 23, 2020

Something like that works for us:

  1. Download the Credentials Provider installation script - link

  2. Open the PowerShell console and run the installation script with the -AddNetfx switch

    .\installcredprovider.ps1 -AddNetfx
    
  3. Navigate to %userprofile%\.nuget\plugins\netfx\CredentialProvider.Microsoft and open Command Prompt there.

  4. Run the following command:

    CredentialProvider.Microsoft.exe -U <your nuget source>
    
  5. Follow the instructions printed to the console window: Open microsoft.com/devicelogin, enter the code and login to the account.

  6. Run the following command to install the template to your dotnet cli templates:

    dotnet new -i <template name> --nuget-source <your nuget source>
    

Hope this will help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet custom template discoverability in private NuGet Feed
I have created a dotnet custom template with a nuget package following this guide: https://learn.microsoft.com/en-us/dotnet/core/tools/custom- ...
Read more >
Custom templates for dotnet new - .NET CLI
You can create your own custom templates for any type of project, such as an app, service, tool, or class library. You can...
Read more >
Consuming packages from authenticated feeds
Consuming packages from authenticated feeds in all NuGet client scenarios.
Read more >
Studio - Managing Activities Packages
Official - The official online UiPath feed, where you can find the activity packages that are officially supported by us. This feed has...
Read more >
NuGet packages in the Package Registry
Publish NuGet packages in your project's Package Registry. Then, install the packages whenever you need to use them as a dependency. The Package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found