nuget.org 上的源无法访问? [英] The source at nuget.org is unreachable?
问题描述
我正在尝试在我的 C# 项目中安装 SignalR,但是在运行 install-package Microsoft.AspNet.SignalR
时我得到的只是:
I'm trying to install SignalR in my C# project, but all I get when running install-package Microsoft.AspNet.SignalR
is:
nuget.org [https://www.nuget.org/api/v2/] 上的源无法访问.回退到 NuGet 本地缓存(...)
在行:1 字符:1+ 安装包 Microsoft.AspNet.SignalR+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException+ FullQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
此错误已多次发布到 Stack Overflow,但没有任何解决方案对我有用.我试过了:
This error was posted to Stack Overflow a few times, but no solution has worked for me. I've tried:
- 开始一个新项目
- 删除和添加我的所有 nuget 源
- 尝试在 nuget 有效的项目中使用
- 重新安装 nuget
- 重新安装 Visual Studio
没有任何效果.我可以通过浏览器很好地访问 nuget.org.
Nothing worked. I can reach nuget.org just fine from my browser.
我希望得到一些帮助.
推荐答案
尝试使用 UI.对我来说,UI 工作正常,但需要明确告知包管理器源在哪里.试试这个命令:
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:
安装包 Microsoft.AspNet.SignalR -Source nuget.org
install-package Microsoft.AspNet.SignalR -Source nuget.org
这篇关于nuget.org 上的源无法访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!