Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet install-package failing

I'm attempting to install xunit version 2.1.0.. However I'm getting the following exception:

Install-Package : Exception 'System.AggregateException' thrown when trying to add source 'https://api.nuget.org/v3/index.json'. Please verify all your o nline package sources are available. At line:1 char:16 + Install-Package <<<< xunit -Version 2.1.0 + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Any ideas on whats going wrong? Sadly google is not giving me anything helpful..

like image 776
Fiona Avatar asked Mar 24 '16 12:03

Fiona


People also ask

How do I force a NuGet package to install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I install NuGet packages missing?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

Could not install NuGet provider install module?

Solution for unable to install NuGet provider for PowerShellRun both cmdlets to set . NET Framework strong cryptography registry keys. After that, restart PowerShell and check if the security protocol TLS 1.2 is added. As of last, install the PowerShellGet module.

Can't update NuGet packages?

Open NuGet Package Manager, go to the package, and uninstall (it should show the new version that you modified the packages. config file to). In NuGet Package Manager, go to the browse tab, find the package you just uninstalled, then install it again.


1 Answers

It is an old question, but it just happened to me, and the solution may help others: In my case it was due to a package source that was not available anymore and I needed to remove it from the NuGet Package manager configuration:

Tools -> NuGet Package Manager -> Package Manager Settings -> go to Package Sources and remove the source that is generating the problem.

And be aware of the fact that this server is not responding! If it is one server of your own, it would be good for you to check what is happening with it. ;)

like image 52
elbecita Avatar answered Oct 31 '22 12:10

elbecita