_From @craigb on June 17, 2017 0:44_
dotnet restore
I would expect it to auth and retrieve information about packages just like nuget.exe restore
.
CredentialProvider.VSS: Getting new credentials for source: ...
Installing ...
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Failed to retrieve information...
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Response status code does not indicate success: 401 (Unauthorized).
nuget help
:
NuGet Version: 4.1.0.2450
dotnet --info
output:
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.4
_Copied from original issue: dotnet/cli#6916_
This was never supported. Refer to documentation: https://www.visualstudio.com/en-us/docs/package/nuget/nuget-exe
Unfortunately, to make use of authenticated feed on VSTS with dotnet.exe, the only option today is to specify a Personal Access Token in plain text as documented here: https://www.visualstudio.com/en-us/docs/package/nuget/dotnet-exe
It does makes sense however to have a mechanism to make this scenario work with dotnet.exe.
Adding this support will help greatly those using dotnet CLI.
It appears Credential Providers are working for dotnet restore
however still failing on dotnet new --install TemplatePackage
.
C:\Program Files\dotnet\sdk\2.1.300-preview2-008533\NuGet.targets(114,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\Dennis\.templateengine\dotnetcli\v2.1.300-preview2-008533\scratch\restore.csproj]
Environment:
NuGet Version: 4.7.0.5104
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.300-preview2-008533
Commit: 996eb6c92c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17133
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.300-preview2-008533\
Host (useful for support):
Version: 2.1.0-preview2-26406-04
Commit: 6833f3026b
I suspect you've got a credential stashed somewhere on disk already, or the packages are already cached. We're working right now to bring cross-plat credential provider support to dotnet, but it hasn't shipped yet.
Duplicate of https://github.com/NuGet/Home/issues/6486. @livarcocc Can we close this one?
Sounds good to me.
@alexmullans i had the packages cached. i cleared my nuget locals all -clear
and dotnet restore
failed as you said.
thanks for tracking this; #6486 will be very welcomed.
Most helpful comment
Adding this support will help greatly those using dotnet CLI.