NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

VS UI nuget.config management #7973

Open karann-msft opened 5 years ago

karann-msft commented 5 years ago
kabua commented 2 years ago

We have come across the following related issue. We are using a protected NuGet feed, thus my credentials are required, and I need to build from both VS 2019 and from the command line.

When trying to access this feed from VS, VS showed me a credentials dialog. After entering my creds, I was able to access the feed. But when I tried from the cmd NuGet couldn't connect due to authorization errors.

Therefore, I ran this cmd (names changed to protect the guilty):

NuGet sources update -Name Feed1 -Source https://nuget.example.com/nuget/feed1/v3/index.json -UserName me -Password my_pwd

In my NuGet.config file I found this new section:

<packageSourceCredentials>
    <Fee1>
      <add key="Username" value="me" />
      <add key="Password" value="aoru63y63nc==" />
    </Fee1>
  </packageSourceCredentials>

After that, I was able to build using the cmd.

However, after making changes using VS options, I noticed that cmd wouldn't work anymore. So I looked at my NuGet.config file and discovered that the <packageSourceCredentials> section was removed entirely!

Expected behavior

1) either VS honors the security settings within NuGet.config or 2) NuGet and VS use the same credential store.