问题
I'm trying to install SignalR in my C# project, but all I get when running install-package Microsoft.AspNet.SignalR
is:
The source at nuget.org [https://www.nuget.org/api/v2/] is unreachable. Falling back to NuGet Local Cache(...)
At line:1 char:1
+ install-package Microsoft.AspNet.SignalR
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
This error was posted to Stack Overflow a few times, but no solution has worked for me. I've tried:
- Starting a new project
- Removing and adding all of my nuget sources
- Trying nuget with projects where it worked
- Reinstalling nuget
- Reinstalling Visual Studio
Nothing worked. I can reach nuget.org just fine from my browser.
I would appreciate some help.
回答1:
Try using the UI. For me the UI works fine but the Package Manager needs to be told explicitly where the source is. Try the command:
install-package Microsoft.AspNet.SignalR -Source nuget.org
回答2:
To work around this, you can run nuget install Microsoft.AspNet from the command line in your solution root. Then when you try again in the Package Manager it will find the cached copy and succeed:
.nuget\NuGet.exe install Microsoft.AspNet.SignalR.Client -OutputDirectory packages
来源:https://stackoverflow.com/questions/26969234/the-source-at-nuget-org-is-unreachable