使用“ dotnet添加软件包-s”安装nuget软件包。指定私人github nuget feed时失败
我有一个来自github的私人供稿,我将其添加到nuget.config
文件:
<add key="github" value="https://nuget.pkg.github.com/..." />
我可以通过使用dotnet nuget list source
source (请参阅下面的ScreenShot)来确认其工作。
但是,当运行dotnet添加软件包-s github packagename
时,它会失败,“没有版本可用于软件包”错误。删除-s github
works(如果它在顶部,则从私有feed安装)。
我可以自己手动运行它(删除-s
),但我正在编写一个脚本以安装其他开发人员。即使它不在列表的顶部,我也需要可靠地从私有供稿安装它。 nuget.org
在我们的私有feed中使用相同的名称。
为什么用-s
指定包源不起作用?我该如何修复?
I have a private feed from GitHub that I added to Nuget.config
file:
<add key="github" value="https://nuget.pkg.github.com/..." />
I can confirm it works by using dotnet nuget list source
(see screenshot below).
However when running dotnet add package -s github PackageName
, it fails with "There are no versions available for the package" error. Removing the -s github
works (and it installs from the Private feed if it is on the top).
Although I can manually run it for myself (removing -s
), I am writing a script to install it for other developers. I need to reliably install it from the private feed even if it's not on the top of the list. There may be packages in nuget.org
with the same name in our private feed.
Why does specifying package source with -s
not work? How do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
microsoft文档
所以我希望命令会这样:
The Microsoft docs are saying:
So I'd expect the command to be like this: