Visual Studio 2022 won't connect to NuGet

Jayakumar R 0 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

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,918 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,190 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
337 questions
{count} votes

3 answers

Sort by: Most helpful
  1. satya karki 986 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 986 Reputation points MVP
    2024-02-19T11:14:52.41+00:00

  3. Bruce (SqlWork.com) 66,621 Reputation points
    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

    0 comments No comments

Your answer

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