You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detailed repro steps so we can see the same problem
Background
We run an internal NuGet server that requires authentication.
To configure the feed to use, we place a nuget.config file in the source code repository, but configure the credentials for the feed in the user's local NuGet.Config
Repro steps
Place a nuget.config in a source code repository or empty folder.
Run nuget restore or nuget install in the repository. NuGet combines the feed url and credentials from the different config files and succeeds to download packages.
Run nuget sources add -name Feed2 -source http://example.com/feed1 from a directory outside the repository so NuGet does not load the repository-config file.
Inspect %APPDATA%\NuGet\NuGet.config. As expected, the source "Feed2" was added.
However, the credentials for Feed1 are no longer present in the config file:
I can repro this, it's because we rewrite the whole nuget.config when we modify the file, in this scenario, nuget added feed2 to nuget.config, but can't find feed1, then the feed1 credential is removed. we should consider this scenario.
rrelyea
changed the title
nuget sources add strips credentials from a user's NuGet.config
nuget sources add should not delete credentials from NuGet.config
Nov 20, 2018
Details about Problem
NuGet product used: NuGet.exe
NuGet version: 4.7.1.5393
Detailed repro steps so we can see the same problem
Background
We run an internal NuGet server that requires authentication.
To configure the feed to use, we place a
nuget.config
file in the source code repository, but configure the credentials for the feed in the user's localNuGet.Config
Repro steps
Place a
nuget.config
in a source code repository or empty folder.Example:
Add the credentials for "Feed1" to
%APPDATA%\NuGet\NuGet.config
.Example (I used
ClearTextPassword
for the example but the behavior is the same when using an encrypted password):Run
nuget restore
ornuget install
in the repository. NuGet combines the feed url and credentials from the different config files and succeeds to download packages.Run
nuget sources add -name Feed2 -source http://example.com/feed1
from a directory outside the repository so NuGet does not load the repository-config file.Inspect
%APPDATA%\NuGet\NuGet.config
. As expected, the source "Feed2" was added.However, the credentials for Feed1 are no longer present in the config file:
Expected:
Actual:
The text was updated successfully, but these errors were encountered: