Pushing NuGet Packages To An Online Repository with the NuGet Client
[C#, .NET, Nuget]
In a previous post, “Pushing NuGet Packages To An Online Repository with dotnet nuget”, we looked at how to use the dotnet nuget tool to upload packages to a repository.
In this post, we will look at an alternative tool for this purpose - the NuGet client.
You would typically use this if:
- You are primarily on the Windows platform
- You are still generating and consuming .NET Framework packages
- You are working with non-SDK projects
If on Windows, you can download it here: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
If on macOS, Linux, or Unix, use the instructions here.
Then add it to your PATH to simplify things, or put it in a location that is already in your PATH.
Then you can use it like this:
nuget push *.* -ApiKey YOUR_KEY_HERE -Source https://YOUR_REPOSITORY PATH HERE/
Here, we are doing the following:
nuget pushinvokes theNuGetclient*.*indicates we want to push all the files in the current directory-ApiKeyindicates the API key to use to authenticate against the repository-Sourceindicates the source, or where the repository is
If everything is in order, you should see the following:

Personally, I use the dotnet nuget tool- it already comes with the .NET SDK and is one less thing to manage.
TLDR
You can use the NuGet client to publish changes to a NuGet repository.
Happy hacking!