-
Notifications
You must be signed in to change notification settings - Fork 258
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
dotnet add package
won't use credentials from global config for a source specified in local config
#6935
Comments
@evil-shrike Thanks for reporting the problem. Can you try storing the password in clear text and try again? |
@mishra14 I've tried with creds in cleartext - no changes, getting same 401 for the source specified in local nuget.config. |
Fixed in NuGet/NuGet.Client#2486 |
dotnet add package
won't use credentials from global config for a source specified in local config
im having this exact same issue on my system: .NET Core SDK : Runtime Environment: dotnet add package output: my NuGet.Config (also tried with encrypted password): <?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
<add key="MyPrivateRepo" value="http://someurl:5100/v3/index.json" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
<packageSourceCredentials>
<MyPrivateRepo>
<add key="Username" value="username" />
<add key="ClearTextPassword" value="password" />
</MyPrivateRepo>
</packageSourceCredentials>
</configuration> |
Same issue here too. I really hope package operations with dotnet CLI will receive some serious love soon. Right now I don't feel I can rely on it for anything serious. |
@Luqswe - I have reopened the issue based on your comments. @Crono1981 - What version of the .NET SDK are you using? |
@aortiz-msft I'm on 3.1.401 |
From @evil-shrike on May 15, 2018 11:40
Steps to reproduce
Given an internal Artifactory server with several repositories, all of them require authentication.
dotnet add package Microsoft.AspNetCore.All
work for an arbitrary new project. That means that all cached credentials in "C:\Users\UserName\AppData\Roaming\NuGet\NuGet.Config" are fine.That global NuGet.Config contains several sources:
Now I'm adding a local NuGet.Config besides my csproj and try the same install:
dotnet add package Microsoft.AspNetCore.All
It fails with 401 Unauthorized!
The local
nuget.config
contains one of the source from global config:If I run nuget.exe (4.6.2.5055) directly it works fine (that is it uses credentials from global config).
Expected behavior
Credentials are being used.
Actual behavior
Installation fails:
Environment data
dotnet --info
output:PS: I double checked that the sources in local config and in global one are the same.
Copied from original issue: dotnet/cli#9281
The text was updated successfully, but these errors were encountered: