Visual Studio 2022 won't connect to NuGet

Jayakumar R 10 Reputation points
2024-02-18T15:42:31.7833333+00:00

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. Error1

Error2

Developer technologies | .NET | Other
Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Developer technologies | .NET | .NET CLI
{count} votes

5 answers

Sort by: Most helpful
  1. satya karki 1,001 Reputation points MVP
    2024-02-19T11:09:30.1033333+00:00

    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

    0 comments No comments

  2. satya karki 1,001 Reputation points MVP
    2024-02-19T11:14:52.41+00:00

  3. Bruce (SqlWork.com) 81,191 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://free.blessedness.top/en-us/nuget/reference/nuget-config-file

    0 comments No comments

  4. 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!
    User's image

    0 comments No comments

  5. 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://free.blessedness.top/en-us/answers/questions/2275907/nuget-package-manager-error-in-visual-studio-2022

    Your support is much appreaciated.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.