12
votes

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..

1
Have you taken a look at your nuget configuration? If you have any sources that have not been configured correctly this is the exception that will be thrown.Pouya Yousefi

1 Answers

32
votes

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. ;)