问题描述
嗨,我已经创建了非常基本的类库项目并创建了 .nupkg。我正在尝试使用以下命令 nuget.exe push -Source -ApiKey az 推送包。每当我这样做时,我都会说
'nuget.exe' is not recognized as an internal or external command,operable program or batch file.
当我在互联网上搜索时,它说要下载 nuget.exe,所以我导航到 nuget 下载页面。对我不好的是它说 nuget.exe 默认随 VS 2019 一起提供。我正在使用 VS 2019。我无法理解这些文档有什么问题,或者我误解了所有这些文档?有人可以帮我确定我应该在哪里下载或者如果我存在路径在哪里以及我应该如何运行上面的命令?任何帮助,将不胜感激。谢谢
解决方法
nuget.exe
可以从“Windows x86 命令行”下的 https://www.nuget.org/downloads 下载。
Visual Studio 2019 包含所有 NuGet 工具,因此无需像以前的 VS 版本一样安装 VSIX 包以支持 NuGet。
请注意,根据您选择的工作负载,Visual Studio 还将安装 dotnet
CLI 作为 .NET SDK 的一部分。因此,您也可以使用 dotnet nuget push
,它的参数略有不同(--source
和 --api-key
,请查看 dotnet nuget push -h
)