|
| 1 | +--- |
| 2 | +title: dotnet package download command |
| 3 | +description: Learn about the 'dotnet package download' command that downloads a NuGet package. |
| 4 | +author: Nigusu-Allehu |
| 5 | +ms.date: 11/06/2025 |
| 6 | +ai-usage: ai-assisted |
| 7 | +--- |
| 8 | +# dotnet package download |
| 9 | + |
| 10 | +> Applies to: ✔️ .NET 10 SDK and later versions. |
| 11 | +
|
| 12 | +## Name |
| 13 | + |
| 14 | +`dotnet package download` — Download one or more NuGet packages to disk. |
| 15 | + |
| 16 | +## Synopsis |
| 17 | + |
| 18 | +``` |
| 19 | +dotnet package download [<packages>...] |
| 20 | + [--output <path>] |
| 21 | + [--configfile <path> ] |
| 22 | + [--prerelease] |
| 23 | + [--source <package source>] |
| 24 | + [--allow-insecure-connections] |
| 25 | + [--interactive] |
| 26 | + [--verbosity <level>] |
| 27 | +
|
| 28 | +dotnet package download -h|--help |
| 29 | +``` |
| 30 | + |
| 31 | +## Description |
| 32 | + |
| 33 | +`dotnet package download` downloads NuGet packages to a local directory. It **does not** add or update `PackageReference` entries in project files and **does not** build or restore a project. |
| 34 | +By default, the command downloads only the packages you specify (no transitive dependencies) to the current working directory. |
| 35 | + |
| 36 | +## Arguments |
| 37 | + |
| 38 | +* **`packages`** |
| 39 | + |
| 40 | + One or more package IDs to download. |
| 41 | + Each package can optionally include a version with `@`. |
| 42 | + If a package version isn't specified, the latest version of the package is downloaded. |
| 43 | + For example, `dotnet package download Contoso.Utilities` or `dotnet package download Contoso.Utilities@3.2.1`. |
| 44 | + |
| 45 | +## Options |
| 46 | + |
| 47 | +* **`--allow-insecure-connections`** |
| 48 | + |
| 49 | + Allows downloading from HTTP sources. Without this flag, insecure sources cause the command to error per [HTTPS-everywhere](https://aka.ms/nuget-https-everywhere) guidance. |
| 50 | + |
| 51 | +* **`--configfile <path>`** |
| 52 | + |
| 53 | + Path to a NuGet.config to use. |
| 54 | + |
| 55 | +* **`--interactive`** |
| 56 | + |
| 57 | + Enables interactive authentication if required. |
| 58 | + |
| 59 | +* **`-o, --output <path>`** |
| 60 | + |
| 61 | + Directory where the package will be placed. Defaults to the current working directory. |
| 62 | + |
| 63 | +* **`--prerelease`** |
| 64 | + |
| 65 | + Allows downloading prerelease versions. |
| 66 | + |
| 67 | +* **`-s --source <package source>`** |
| 68 | + |
| 69 | + Specifies the NuGet package source to use. |
| 70 | + |
| 71 | +* **`-v, --verbosity <level>`** |
| 72 | + |
| 73 | + Set the verbosity level of the command. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`. |
| 74 | + |
| 75 | +[!INCLUDE [help](../../../includes/cli-help.md)] |
| 76 | + |
| 77 | +## Examples |
| 78 | + |
| 79 | +### Download a single package at a specific version |
| 80 | + |
| 81 | +```ps1 |
| 82 | +dotnet package download Contoso@13.0.3 --output My/Destination/For/packages |
| 83 | +``` |
| 84 | + |
| 85 | +### Download multiple packages to a custom folder |
| 86 | + |
| 87 | +```ps1 |
| 88 | +dotnet package download Contoso@3.1.2 Contoso.Utility@6.12.0 --output My/Destination/For/packages |
| 89 | +``` |
0 commit comments