Can you please try these steps?
1- go to %appdata%\NuGet\NuGet.config
2- Verify the urls mentioned in that config
3- Remove the url which is not required
4- Restart visual studio and check
Visual Studio 2022 won't connect to NuGet
Visual Studio 2022:
[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. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. An existing connection was forcibly closed by the remote host
I have attached snapshot for your reference.
Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
Developer technologies | .NET | .NET CLI
5 answers
Sort by: Most helpful
-
satya karki 996 Reputation points MVP
2024-02-19T11:09:30.1033333+00:00 -
satya karki 996 Reputation points MVP
2024-02-19T11:14:52.41+00:00 You can refer this thread. https://learn.microsoft.com/en-us/answers/questions/959588/visual-studio-2022-wont-connect-to-nuget
-
Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
2024-03-05T16:59:03.59+00:00 Most likely you are using a proxy. You can check the browser for the setting, and then configure nuget to use a proxy:
https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file
-
hiro-0606 5 Reputation points
2025-03-24T23:58:05.77+00:00 I had the same issue with nuget in VS 2022 after updating to Windows version 24H2.
I've added SchUseStrongCrypto DWORD with value 1 to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0.50727
and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v4.0.30319 and after rebooting it works for me again. Hope it helps!
-
Syed Aun M. Bukhari 5 Reputation points
2025-05-14T19:47:33.4866667+00:00 Hello Guys, I am facing the same issue, everything was working now continously I am facing the mentioned error:
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. Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
The recent changes on my machine were:
Windows Updates & Bitdefender installation...
I tried all the steps stated in the thread but still cant access now https://api.nuget.org/v3/index.json from visual studio as well as from any browser. I am not behind any proxy. Any Advise please?
details of my issue are in this thread as well:
https://learn.microsoft.com/en-us/answers/questions/2275907/nuget-package-manager-error-in-visual-studio-2022Your support is much appreaciated.