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.
3 answers
Sort by: Most helpful
-
satya karki 986 Reputation points MVP
2024-02-19T11:09:30.1033333+00:00 -
satya karki 986 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) 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