Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use 'dotnet restore' with a feed that need to authenticate with?

Tags:

.net

nuget

My project uses a custom feed that I need to authenticate to before using it. https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-restore tells me that --interactive flag should be used. However, that doesn't change anything. I'm getting errors:

/usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : Unable to load the service index for source https://myproject.pkgs.visualstudio.com/_packaging/MyFeed/nuget/v3/inde x.json. [/home/xyx/code/MyApp.csproj] /usr/share/dotnet/sdk/3.1.201/NuGet.targets(124,5): error : Response status code does not indicate success: 401 (Unauthorized). [/home/xyx/code/MyApp.csproj]

How to I authorize to my feed?

like image 879
mnj Avatar asked Apr 23 '20 11:04

mnj


1 Answers

To make dotnet ask you for credentials, you need to install https://github.com/microsoft/artifacts-credprovider. It solves the problem.

like image 53
mnj Avatar answered Oct 18 '22 22:10

mnj