Visual Studio 2022 error: [nuget.org] Failed to retrieve metadata from source

Irek Zawadzki 11 Reputation points
2022-07-27T16:36:32.867+00:00

I am having trouble using NuGet in Visual Studio. I selected "Managed NuGet packages for solution..." and tried using NuGet browser by entering a string in the Search field. I get the following error:

[nuget.org] Failed to retrieve metadata from source 'https://azuresearch-ussc.nuget.org/query?q=&skip=0&take=26&prerelease=false&supportedFramework=.NETFramework,Version=v4.7.2&semVerLevel=2.0.0'.  
  An error occurred while sending the request.  
  The request was aborted: Could not create SSL/TLS secure channel.  

----------

Some additional details:
My operating systems is Windows 10 Enterprise, Version 21H2
My NuGet source is set to nuget.org https://api.nuget.org/v3/index.json

This error initially appeared in VisualStudio 2019. NuGet manager used to work on my machine a few months ago and only recently I noticed this error.

I uninstalled VS 2019 and installed Visual Studio 2022. Still got the same error. Also tried changing .NET framework from 4.7.2 to 4.8 - this did not help either.

I pasted the source https address from the error message in my Edge browser and had no problem connecting. The browser displayed a very long string starting with the following:
{"@Георгий Георгиевский ":{"@vocab":"http://schema.nuget.org/schema#","@BASE ":"https://api.nuget.org/v3/registration5-gz-semver2/"},"totalHits":274432,"data":[{"@id":"https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/index.json","@type ":"Package","registration":"https://api.nuget.org/v3/registration5-gz-

My colleague in my office is running Visual Studio 2019 and has no problem using NuGet manager.

From Internet search I suspect that some registry settings in my computer registry are not configured properly to work with the Visual Studio internal browser. I did not personally make any changes to my computer settings except for accepting updates and new software pushed to my computer by our IT department (mostly Microsoft products). I recently installed Microsoft Project Professional.

I would appreciate some help on how to troubleshoot this issue.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,926 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,203 questions
{count} vote

4 answers

Sort by: Most helpful
  1. devolution 5 Reputation points
    2023-12-22T12:10:37.66+00:00

    I had the "[nuget.org] Failed to retrieve metadata from source" issue after updating to 17.8.3. Usually, when I get an error installing nuget packages, I close Visual Studio, delete the hidden .vs folder and try again. I did that and it did solved this issue.

    1 person found this answer helpful.

  2. satya karki 986 Reputation points MVP
    2022-07-28T03:54:25.757+00:00

  3. Tianyu Sun-MSFT 31,326 Reputation points Microsoft Vendor
    2022-07-28T07:28:20.19+00:00

    Hi @Irek Zawadzki ,

    Welcome to Microsoft Q&A forum.

    Please check this blog: Ensuring your system uses TLS 1.2.

    You may need to confirm and enable the TLS 1.2 support for your Windows OS.

    Best Regards,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

  4. Irek Zawadzki 11 Reputation points
    2022-08-17T18:20:04.607+00:00

    Upgrading Visual Studio Professional 2022 to Version 17.3.1 solved my problem. I no longer get an error when I try to browse NuGet packages.


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.