【问题标题】:How do I download a package from the command line with .NET Core from nuget?如何使用 .NET Core 从命令行从 nuget 下载包?
【发布时间】:2018-06-09 16:18:49
【问题描述】:

Microsoft 为 Ubuntu 打包 .NET Core on Linux。我目前正在使用它。我现在想安装Json.NET,它指示我使用Package Manager console 并运行,

PM> Install-Package Newtonsoft.Json

我想知道我是如何做到这一点的 Linux 的。我看到有一个 Nuget CLI,但它似乎在 .NET Core 上不可用。 Moreover the docs say

在 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.

【问题讨论】:

    标签: c# .net linux .net-core .net-core-2.0


    【解决方案1】:

    dotnet add package --help

    dotnet add package Newtonsoft.Json

    更多详情请参考github页面https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-add-package.md

    【讨论】:

    • Beautiful "添加对项目的引用。" 显然意味着从远程存储库下载和安装.. npm install, cpanm --install pip install gem install。 Microsoft..“添加对项目的引用。”
    • notepad yourproject.csproj。哦,完成后不要忘记 Ctrl-S!
    猜你喜欢
    • 2019-09-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-15
    • 1970-01-01
    • 2020-07-14
    • 1970-01-01
    • 2018-04-11
    • 1970-01-01
    相关资源
    最近更新 更多