如何使用 .NET Core 从 nuget 从命令行下载包? [英] How do I download a package from the command line with .NET Core from nuget?
问题描述
Microsoft 软件包 Linux 上的 .NET Core对于 Ubuntu.我目前正在使用它.我现在想安装 Json.NET 它指示我使用 Package Manager 控制台 并运行,
Microsoft packages .NET Core on Linux for Ubuntu. I'm currently using that. I now want to install Json.NET which instructs me to use the Package Manager console and run,
PM> Install-Package Newtonsoft.Json
我想知道我是怎么做那个 Linux 的.我看到有一个 Nuget CLI,但是它似乎不适用于 .NET Core.此外文档说
I'm wondering how I do that Linux. I see that there is a Nuget CLI, but it doesn't seem like that's available on .NET Core. Moreover the docs say
在 Mac 和 Linux 上,安装 Mono 4.4.2 或更高版本.
On Mac and Linux, install Mono 4.4.2 or later.
如何在 Linux 上简单地安装软件包?npm/cpan/pip/gem 的 .NET 等价物是什么?
How do I simply install a package on Linux? What's the .NET equivalent of npm/cpan/pip/gem?
当我运行 dotnet nuget
时,install
命令似乎丢失了.
When I run dotnet nuget
, the install
command seems to be missing.
NuGet Command Line 4.3.0.5
Usage: dotnet nuget [options] [command]
Options:
-h|--help Show help information
--version Show version information
-v|--verbosity <verbosity> The verbosity of logging to use. Allowed values: Debug, Verbose, Information, Minimal, Warning, Error.
Commands:
delete Deletes a package from the server.
locals Clears or lists local NuGet resources such as http requests cache, packages cache or machine-wide global packages folder.
push Pushes a package to the server and publishes it.
Use "dotnet nuget [command] --help" for more information about a command.
推荐答案
dotnet add package --help
dotnet 添加包 Newtonsoft.Json
请参考github页面https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-add-package.md 了解更多详情.
Please refer to the github page https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-add-package.md for more details.
这篇关于如何使用 .NET Core 从 nuget 从命令行下载包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!