简体   繁体   English

有没有办法在不创建 csproj 的情况下安装 nuget 包?

[英]Is there a way to install a nuget package without creating a csproj?

I'm looking through the dotnet CLI and nuget CLI to see if there's anything which will download a package from a feed, without having to do a restore against a csproj file.我正在浏览 dotnet CLI 和 nuget CLI,看看是否有任何东西可以从提要下载包,而不必对 csproj 文件进行还原。

The reason for this is I have a pipeline which needs to download a nuget package to use something inside it, but I've no application so no need for a csproj.这样做的原因是我有一个管道,需要下载一个 nuget 包才能在其中使用一些东西,但我没有应用程序,所以不需要 csproj。

Is it possible in the command line to simply say: "Download this nuget package to this location?"是否可以在命令行中简单地说: “将此 nuget 包下载到此位置?”

Needs to be via nuget because the nuget feed is already configured with an ADO token (trying to avoid having to manage credentials).需要通过 nuget,因为 nuget 提要已经配置了 ADO 令牌(试图避免必须管理凭据)。

You are probably looking for the nuget CLI ( download here )您可能正在寻找 nuget CLI(在此处下载

Once you have downloaded the CLI, you can install packages like so:下载 CLI 后,您可以像这样安装软件包:

nuget install NewtonSoft.Json

Here is the reference I used 是我使用的参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM