Visual Studio 2017 Professional- Unable to find package at source

10,953

Solution 1

Assuming you are using Windows OS Have you initialised vs 2017 after installation or Have you updated your vs 2017?

  1. If not then please initialized it.
  2. Restart your PC.
  3. Open your project in vs 2017
  4. Check your nuget package manager settings.

    Name:nuget.org

    Source:api.nuget.org/v3/index.json

Now, run nuget package manager from tools=>Nuget Package Manager=>Package Manager Console and write your install-package command or run Manage nuget package manager for solution from tools=>Nuget Package Manager=>

Hope,it helps you.

Solution 2

I resolved this issue by adding nuget.org which was missing in my package source.

Go to Tools>Nuget package manager>Package Sources>

Click Plus sign > Name: nuget.org Source : https://api.nuget.org/v3/index.json Now your Visual studio will be connected to Internet and package will be downloaded successfully. enter image description here

Solution 3

Your VS 2017 is probably using some kind of proxy setting which is preventing it from accessing the internet.

To check if VS can access internet try opening any web page from within VS Browser. If you cannot browse then my hunch is correct.

Solve the proxy issue and you should be fine.

Hope it helps.

Share:
10,953
Iswar
Author by

Iswar

I am .Net Core Programmer with experience in Angular 7, SQL Server, Bootstrap framework and have a desire to learn

Updated on June 18, 2022

Comments

  • Iswar
    Iswar almost 2 years

    I was trying to add package through nuget package manager=> package manager console and from Manage Nuget packages from solution directly. I am trying to install Newtonsoft.Json from Package Manager Like this Install-Package Newtonsoft.Json but unable to find from the source i.e

     Name: nuget.org
     Source: https://api.nuget.org/v3/index.json
    

    This gives me result like this:

    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.PackageManagement.PowerShellCmdlets.InstallPackageCommand
    
    Time Elapsed: 00:01:30.2571879
    

    I think that the source here is blank. May be because of that it is unable to load packages. I have tried to manage the package manager setting but not been able to connect. My package manager setting is like this: Package Manager General Setting

    Package Source Setting

    Despite of having good connection of internet I am not been able to install package. My questions are:

    1. How should I install package?
    2. What am I doing wrong to install package?
    • boop_the_snoot
      boop_the_snoot almost 7 years
      Is this visual studio 2017 Express Edition?
    • Iswar
      Iswar almost 7 years
      No it is professional I am using.
    • Leo Liu
      Leo Liu almost 7 years
      @Iswar K Chettri, according to the error message, this issue seems caused by the network access the nuget.org. You can try access the url:api.nuget.org/v3/index.json from browser to check whether it can be accessed from browser directly, and could you find any package from NuGet Package Manager UI?
    • Iswar
      Iswar almost 7 years
      Yes I have tried this one also but seems unreachable
  • Iswar
    Iswar almost 7 years
    it is accessing the web page from within the VS Browser. I have tried this url https://msdn.microsoft.com/en-in/default.aspx it works fine
  • alexb
    alexb over 6 years
    I've got the same problem. Doesn't seem to matter which package I try to install...get the same error with all. Running Win7x64. Also running VS2015, VS2013, VS2012 and VS2010. VS2017 is the only one I have the problem with, though. I've updated Nuget itself several times with no luck. :(
  • Dylan
    Dylan over 4 years
    Installing VS 2019 on a machine that already had 2017 I encountered OPs problem. For whatever reason in "Tools|Options|NuGet Package Manager|Package Sources" there were a bunch of weird local sources listed. Disabling these and clicking update on the nuget.org one (unsure if this step necessary) fixed my problem.