Manage NugetPackage for Solution can't find any online packages

13k views Asked by At

Somehow, the "Manage NuGet Packages for Solution..." Dialog doesn't show any online packages anymore (no items found.):

enter image description here

But the "Manage NuGet Packages..." dialog at the project level works fine.

I already tryed to start Visual Studio (2013 Update 4) with the /Log Parameter but cannot find any errors in the ActivityLog.xml.

Any Ideas?

5

There are 5 answers

1
Codeguard On BEST ANSWER

I believe one of your repositories.config files is corrupted or read-only. I suggest that you backup everything, then delete repositories.config one by one until the problem is resolved. Once you know which file to blame, you can take a closer look to figure what happened to it.

0
LosManos On

The package source is missing from your nuget manager.

Without experimenting too much I see two ways to solve it. (as of vs17/2021)

  1. Do as the answer above (remove nuget.config and restart visual studio)
  2. Add nuget as source through menu:Tool->Options->NugetPackageManger->PackageSources and add [name='nuget'], [source='https://api.nuget.org/v3/index.json'] (image below)

For more clarity: I did as 1) and my nuget.config went from

<?xml version="1.0"?>
<configuration>
  <packageSources>
  </packageSources>
</configuration>

to

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

so a third option would be to hack the nuget.config manually, and restart visual studio.

enter image description here

0
Ads On

I had an issue with Nuget 4.3.1 and I had to delete my NuGet.config file in %AppData%\NuGet\

Close Visual Studio 2015, delete the NuGet.config file in %AppData%\NuGet\ and restart Visual Studio.

A new NuGet.Config file is generated and I was able to get back to work.

If you're in doubt, take a copy of the file first.. ;-)

1
klmlfl On

This worked for me:

Delete:

%AppData%\NuGet\Nuget.config

Restart Visual Studio

0
Alan Baljeu On

VS 2017: In my solution, I had a .nuget folder (a solution artifact, not necessarily a file folder) with a .config file which file was missing. I deleted that folder and restarted visual studio. After this things worked.