dotnet-nuget-push - Man Page

Pushes a package to the server and publishes it.

dotnet nuget push

This article applies to: ✔️ .NET Core 3.1 SDK and later versions

Synopsis

dotnet nuget push [<ROOT>] [-d|--disable-buffering] [--force-english-output]
    [--interactive] [-k|--api-key <API_KEY>] [-n|--no-symbols]
    [--no-service-endpoint] [-s|--source <SOURCE>] [--skip-duplicate]
    [-sk|--symbol-api-key <API_KEY>] [-ss|--symbol-source <SOURCE>]
    [-t|--timeout <TIMEOUT>]

dotnet nuget push -h|--help

Description

The dotnet nuget push command pushes a package to the server and publishes it. The push command uses server and credential details found in the system’s NuGet config file or chain of config files. For more information on config files, see Configuring NuGet Behavior. NuGet’s default configuration is obtained by loading %AppData%.config (Windows) or $HOME/.nuget/NuGet/NuGet.Config (Linux/macOS), then loading any nuget.config or .nuget.config starting from the root of drive and ending in the current directory.

The command pushes an existing package. It doesn’t create a package. To create a package, use dotnet pack.

Hierarchical folder structure

This command can store packages in a hierarchical folder structure, which is recommended to optimize performance. It stores packages in a hierarchical folder structure when publishing to a local folder (feed), like nuget add does, if there already is at least one package in the feed that is in a hierarchical folder structure. If the feed has a hierarchical folder structured package already in it, dotnet nuget push respects that structure. So, if you want to publish to a local feed using the .NET CLI instead of the NuGet CLI:

  • Before you publish the first package, go to your global packages folder, at *%userprofile%.nuget, and select the root folder of a package id. It can be any package that is not part of a framework, like .NET standard or ASP.NET.
  • Copy the selected package folder into the root folder of the local feed.
  • Use dotnet nuget push to publish your package to the local feed.
  • You can now delete the folder you previously copied in, and you can freely use dotnet nuget push to publish to your local feed.

Alternatively, use the NuGet CLI for the first package, then you can use dotnet nuget push for the rest. For more information, see Local feeds.

Arguments

Options

Examples

Info

2024-10-02 .NET Documentation