How do I download a package from the command line with .NET Core from nuget?

南楼画角 提交于 2019-12-10 19:28:06

问题


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

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

On Mac and Linux, install Mono 4.4.2 or later.

How do I simply install a package on Linux? What's the .NET equivalent of npm/cpan/pip/gem?

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.

回答1:


dotnet add package --help

dotnet add package Newtonsoft.Json

Please refer to the github page https://github.com/dotnet/docs/blob/master/docs/core/tools/dotnet-add-package.md for more details.



来源:https://stackoverflow.com/questions/48018965/how-do-i-download-a-package-from-the-command-line-with-net-core-from-nuget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!