9

Since today for some reason I'm unable to connect to the NuGet package manager through Visual Studio.

[nuget.org] Unable to load the service index for source https://api.nuget.org/v3/index.json.
  An error occurred while sending the request.
  The underlying connection was closed: An unexpected error occurred on a send.
  Authentication failed because the remote party has closed the transport stream.

But I cannot get it to work again... Things I tried.

TLS1.2 Client settings: TLS1.2

TLS1.2 Server settings: TLS1.2

Specs: Windows Server 2012R2, Visual Studio 2019

Also tried it on a different Windows Server 2012R2 machine and same problem

It is still working on my laptop with Windows 10.

Hopefully someone has an idea.

Thanks

Giel83
  • 105
  • 1
  • 1
  • 4

3 Answers3

6

I had the same problem.

The solution was to install the microsoft/artifacts-credprovider as mentioned on that page.

Invoke-Expression "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
Ryan Griffith
  • 1,591
  • 17
  • 41
R00st3r
  • 954
  • 1
  • 10
  • 31
  • This solved my issues with restoring packages from an internal NuGet repository hosted on Azure from the CLI (which would fail even though VS22' restored without issue). – zcoop98 Apr 11 '23 at 16:57
3

Had exactly the same problem, running script from https://github.com/microsoft/azure-devops-tls12 and following instructions from it helped me. In my case it generated additional script file, after running that and restaring pc nuget was working once again.

Kejim
  • 46
  • 1
0

one of the classic reason...

Possible Problem: Stale Artifactory Credentials in Credential Manager You have saved credentials for your artifactory in credential manager. If your system/SSO credentials changed recently then this will happen.

Solution: Update/Remove Saved credentials from Credentials Manager Go to Windows => Credentials manager => Windows Credentials => Generic Credentials => [Artifactory related Credentials] => Remove.

When you rebuild from visual studio it will again ask for fresh credentials. It's upto you whether want to save or add every time.

Credential manager - [1]

Enter credentials after rebuild in VS [2]

Arvind Maurya
  • 910
  • 12
  • 25