cannot install any packages - ERROR -https://packagesource

HELEN TRAN 1 Reputation point
2022-10-13T09:04:24.997+00:00

-[Package source] Unable to load the service index for source https://packagesource.
An error occurred while sending the request.

-Restore could not be completed because the listed source is unavailable.

-PM> Install-Package Newtonsoft.Json
Install-Package : Unable to find package 'Newtonsoft.Json' at source ''.
At line:1 char:1

  • Install-Package Newtonsoft.Json
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Install-Package], Exception
  • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManag
    ement.PowerShellCmdlets.InstallPackageCommand
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,879 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
999 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 30,821 Reputation points Microsoft Vendor
    2022-10-13T13:23:30.717+00:00

    Hello @HELEN TRAN ,

    Welcome to Microsoft Q&A forum.

    Please open Visual Studio > Tools > NuGet Package Manager > Package Manager Settings > Package Sources > check if any invalid package sources are still list there, if so try to remove them or uncheck them, and make sure that the valid package source like nuget.org is checked, then retry installing NuGet package.

    Besides, you may need to try to clean NuGet cache, see this document for details: Clearing local folders.

    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.

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.