如何使用.NET Core从nuget命令行下载软件包?

7

微软将.NET Core on Linux打包为Ubuntu版本。我目前正在使用它。现在我想安装Json.NET,它告诉我要使用Package Manager console并运行以下命令:

PM> Install-Package Newtonsoft.Json

我想知道如何在Linux上执行此操作。我看到有一个Nuget CLI,但似乎在.NET Core上不可用。此外,文档说

在Mac和Linux上,安装Mono 4.4.2或更高版本。

我应该如何在Linux上简单地安装一个软件包?与npm/cpan/pip/gem相对应的是什么.NET工具?
当我运行dotnet nuget时,install命令似乎已经丢失了。
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.
1个回答

9

1
美丽的“添加项目引用”显然意味着从远程仓库下载和安装。npm installcpanm --installpip installgem install。微软...“添加项目引用”。 - Evan Carroll
记事本打开你的项目.csproj文件。完成后别忘了按Ctrl-S保存! - Pac0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接