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
Regression in .NET SDK 500: 'dotnet tool install' fails with 401 (Unauthorized) when there is a private feed in NuGet.config #7524
Comments
Does it work if you just run Alternatively, if this is a VSTS feed, can you run |
From @hrumhurum on November 17, 2018 10:6
Trying to run |
From @hrumhurum on November 17, 2018 10:40 A small ready-to-use reproduction sample that shows the error with an existing authenticated MyGet feed: The repro is real and self-sufficient. Just launch the It does not work with .NET SDK 2.1.500. P.S. You may need to invoke |
This seems to be the same issue from #7517. @hrumhurum can you try not using spaces in the source name and see if that fixes it? Note that the credentials element should match the source name so you might have to edit that one as well... |
@PatoBeltran Removing spaces from the source name does not affect the outcome. The issue still persists. |
Try updating the nuget.config to something like:
|
I was having this issue and removing the space from the source name did fix it. It seemed that using a clear text password kind of fixed it (still failed for custom packages output folder), but no space in the name and it works well now. |
@PatoBeltran I followed with the template you have provided. In that case, it does work fine. The pitfall is this: not only the space character causes the issue, but any other special character like '&' does. Please find enclosed a ready to use reproduction sample that shows both ' ' and '&' characters causing the problem: |
@hrumhurum Your repro solution confirms that the issue is duplicate of #7517. With that I mean, the fix for #7517 will cover all special characters. Please follow that one for updates. |
I was having this issue as well when trying to use the
I added the
Please note that I didn't remove the .NET SDK 2.1.500 from the build agent. |
We use the .NET Core SDK 2.2.102 (via the ".NET Core Tool Installer" TFS build task) and .NET restore still fails with the same error. Our private feed has dot in its name like "Foo.Bar". |
In the end what worked for me was
|
I am not sure if there is supposed to be something in From the command line, My temporary fix - which will break other things, was to comment out the references to my private feeds in I am using .Net SDK 5.0.0 and don't have .Net SDK 2.1.500 installed. |
From @hrumhurum on November 17, 2018 1:29
Steps to reproduce
Expected behavior
Tool 'contoso.foobar' (version '1.2.3') was successfully installed.
Actual behavior
C:\Program Files\dotnet\sdk\2.1.500\NuGet.targets(114,5): error : Failed to retrieve information about 'contoso.foobar' from remote source 'https://rd.contoso.com:12345/nuget/feed/FindPackagesById()?id='contoso.foobar'&semVerLevel=2.0.0'. [C:\Users\Tester\AppData\Local\Temp\h2vj5tjo.mmy\restore.csproj]
C:\Program Files\dotnet\sdk\2.1.500\NuGet.targets(114,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\Tester\AppData\Local\Temp\h2vj5tjo.mmy\restore.csproj]
The tool package could not be restored.
Environment data
dotnet --info
output:.NET Core SDK (reflecting any global.json):
Version: 2.1.500
Commit: b68b931422
Runtime Environment:
OS Name: Windows
OS Version: 6.3.9600
OS Platform: Windows
RID: win81-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.500\
Host (useful for support):
Version: 2.1.6
Commit: 3f4f8eebd8
.NET Core SDKs installed:
1.0.4 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.0 [C:\Program Files\dotnet\sdk]
2.1.102 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.500 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Notes
The issue is not present in .NET Core SDK 2.1.400, e.g. it goes away when .NET Core SDK 2.1.500 is uninstalled, and reappears when SDK 2.1.500 is installed again.
Here is the sample
NuGet.config
fromC:\Users\Tester\Application Data\NuGet
folder:Copied from original issue: dotnet/cli#10356
The text was updated successfully, but these errors were encountered: