NuGet for .NET Core on Linux
With recent .NET Core SDK releases, such as 1.0.0 RC4, NuGet is shipped with .NET Core. You can directly access NuGet by specifying it as a command with dotnet
:
dotnet nuget
If the version of the .NET Core SDK does not support that you could look at downloading a nightly build of NuGet v4. There is a NuGet.CommandLine.Xplat NuGet package which supports being run on .NET Core. However, you need all its dependencies in the same folder and the NuGet package does not specify them. Downloading just the NuGet.CommandLine.Xplat NuGet package will not work directly. It will show an error about missing NuGet assemblies.
Your final option, which you said you did not want to do, is to install Mono.
How to install Nuget package using windows command line in C# project?
Install-Package is how you install via Visual Studio. The cmdlet to install a package via the CLI is nuget install <Package-Name>
.
Please see this Microsoft Doc for reference:
https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-nuget-cli
How do I download a package from the command line with .NET Core from nuget?
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.
NuGet on the Docker
I see the only reason you're trying to get nuget.exe is to add credentials. This page in the docs has links on how to authenticate to Azure Devops using the dotnet cli. Your use case falls into the "otherwise" sentence of the CI builds section, so you can use an environment variable to specify your PAT. Therefore, you don't actually need nuget.
Related Topics
How to Pass a Wildcard Parameter to a Bash File
Extract Lines Between Two Patterns from a File
Using "$Random" to Generate a Random String in Bash
How Does Bash Deal with Nested Quotes
How to Trim White Space from a Variable in Awk
How to Remove the Bom from a Utf-8 File
Creating a Bootable Iso Image with Custom Bootloader
What Do These Kernel Panic Errors Mean
Linux Time Command Microseconds or Better Accuracy
What Is Path //, How Is It Different from /
Linux Removing Folders Older Than 1 Year and More Than 3 Files
Command Line: Search and Replace in All Filenames Matched by Grep
Sending a Mail from a Linux Shell Script
Bash - How to Pipe Result from the Which Command to Cd
Setting the Vim Background Colors
Makefile That Distinguishes Between Windows and Unix-Like Systems