Skip to content

Commit 7bb6a1a

Browse files
Add documentation for dotnet package download command (#49659)
1 parent 78e27f3 commit 7bb6a1a

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
```

docs/core/tools/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The following commands are installed by default:
7474
### Project modification commands
7575

7676
- [`package add`](dotnet-package-add.md)
77+
- [`package download`](dotnet-package-download.md)
7778
- [`package list`](dotnet-package-list.md)
7879
- [`package remove`](dotnet-package-remove.md)
7980
- [`package search`](dotnet-package-search.md)

docs/navigate/tools-diagnostics/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ items:
182182
items:
183183
- name: dotnet package add
184184
href: ../../core/tools/dotnet-package-add.md
185+
- name: dotnet package download
186+
href: ../../core/tools/dotnet-package-download.md
185187
- name: dotnet package list
186188
href: ../../core/tools/dotnet-package-list.md
187189
- name: dotnet package remove

0 commit comments

Comments
 (0)