Skip to content

Commit b0a9b06

Browse files
committed
Switch from dvn to dnv
(dotnet verb noun to dotnet noun verb) This is for the dotnet package/reference add/list/remove commands.
1 parent 9148564 commit b0a9b06

6 files changed

+70
-70
lines changed

docs/core/tools/dotnet-add-package.md docs/core/tools/dotnet-package-add.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
title: dotnet add package command
3-
description: The 'dotnet add package' command provides a convenient option to add a NuGet package reference to a project.
2+
title: dotnet package add command
3+
description: The 'dotnet package add' command provides a convenient option to add a NuGet package reference to a project.
44
ms.date: 04/13/2022
55
---
6-
# dotnet add package
6+
# dotnet package add
77

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

1010
## Name
1111

12-
`dotnet add package` - Adds or updates a package reference in a project file.
12+
`dotnet package add` - Adds or updates a package reference in a project file.
1313

1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet add [<PROJECT>] package <PACKAGE_NAME>
18-
[-f|--framework <FRAMEWORK>] [--interactive]
17+
dotnet package add <PACKAGE_NAME>
18+
[-f|--framework <FRAMEWORK>] [--interactive] [--project <PROJECT>]
1919
[-n|--no-restore] [--package-directory <PACKAGE_DIRECTORY>]
2020
[--prerelease] [-s|--source <SOURCE>] [-v|--version <VERSION>]
2121
22-
dotnet add package -h|--help
22+
dotnet package add -h|--help
2323
```
2424

2525
## Description
2626

27-
The `dotnet add package` command provides a convenient option to add or update a package reference in a project file. When you run the command, there's a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes and the package isn't referenced in the project file, a `<PackageReference>` element is added to the project file. If the check passes and the package is already referenced in the project file, the `<PackageReference>` element is updated to the latest compatible version. After the project file is updated, [dotnet restore](dotnet-restore.md) is run.
27+
The `dotnet package add` command provides a convenient option to add or update a package reference in a project file. When you run the command, there's a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes and the package isn't referenced in the project file, a `<PackageReference>` element is added to the project file. If the check passes and the package is already referenced in the project file, the `<PackageReference>` element is updated to the latest compatible version. After the project file is updated, [dotnet restore](dotnet-restore.md) is run.
2828

2929
For example, adding `Microsoft.EntityFrameworkCore` to *ToDo.csproj* produces output similar to the following example:
3030

@@ -57,7 +57,7 @@ The following scenarios are currently supported. These examples assume that the
5757

5858
Scenario 1: `<PackageReference>` does not exist in the project file, `<PackageVersion>` element does not exist in the `Directory.Packages.props file`, and the version argument is not passed from the commandline.
5959

60-
CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore`
60+
CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --project ToDo.csproj`
6161

6262
The `<PackageVersion>` element is added to the `Directory.Packages.props file`.
6363

@@ -73,7 +73,7 @@ Scenario 1: `<PackageReference>` does not exist in the project file, `<PackageVe
7373

7474
Scenario 2: `<PackageReference>` does not exist in the project file, `<PackageVersion>` element does not exist in the `Directory.Packages.props file`, and the version argument is passed from the commandline.
7575

76-
CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore --version 5.0.4`
76+
CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --version 5.0.4 --project ToDo.csproj`
7777

7878
The `<PackageVersion>` element is added to the `Directory.Packages.props file`.
7979

@@ -89,7 +89,7 @@ Scenario 2: `<PackageReference>` does not exist in the project file, `<PackageVe
8989

9090
Scenario 3: `<PackageReference>` does not exist in the project file, `<PackageVersion>` element does exist in the `Directory.Packages.props file`, and the version argument is not passed from the commandline.
9191

92-
CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore`
92+
CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --project ToDo.csproj`
9393

9494
The `<PackageVersion>` element is added to the `Directory.Packages.props file`.
9595

@@ -105,7 +105,7 @@ The `<PackageReference>` element is added to the project file.
105105

106106
Scenario 4: `<PackageReference>` does not exist in the project file, `<PackageVersion>` element does exist in the `Directory.Packages.props file`, and the version argument is passed from the commandline.
107107

108-
CLI command that is executed: `dotnet add ToDo.csproj package Microsoft.EntityFrameworkCore --version 5.0.4`
108+
CLI command that is executed: `dotnet package add Microsoft.EntityFrameworkCore --version 5.0.4 --project ToDo.csproj`
109109

110110
The `<PackageVersion>` element is added to the `Directory.Packages.props file`.
111111

@@ -168,19 +168,19 @@ Scenario 4: `<PackageReference>` does not exist in the project file, `<PackageVe
168168
- Add `Microsoft.EntityFrameworkCore` NuGet package to a project:
169169

170170
```dotnetcli
171-
dotnet add package Microsoft.EntityFrameworkCore
171+
dotnet package add Microsoft.EntityFrameworkCore
172172
```
173173

174174
- Add a specific version of a package to a project:
175175

176176
```dotnetcli
177-
dotnet add ToDo.csproj package Microsoft.Azure.DocumentDB.Core -v 1.0.0
177+
dotnet package add Microsoft.Azure.DocumentDB.Core -v 1.0.0 --project ToDo.csproj
178178
```
179179

180180
- Add a package using a specific NuGet source:
181181

182182
```dotnetcli
183-
dotnet add package Microsoft.AspNetCore.StaticFiles -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
183+
dotnet package add Microsoft.AspNetCore.StaticFiles -s https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
184184
```
185185

186186
## See also

docs/core/tools/dotnet-list-package.md docs/core/tools/dotnet-package-list.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
---
2-
title: dotnet list package command
3-
description: The 'dotnet list package' command provides a convenient option to list the package references for a project or solution.
2+
title: dotnet package list command
3+
description: The 'dotnet package list' command provides a convenient option to list the package references for a project or solution.
44
ms.date: 04/13/2022
55
---
6-
# dotnet list package
6+
# dotnet package list
77

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

1010
## Name
1111

12-
`dotnet list package` - Lists the package references for a project or solution.
12+
`dotnet package list` - Lists the package references for a project or solution.
1313

1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet list [<PROJECT>|<SOLUTION>] package [--config <SOURCE>]
18-
[--deprecated]
17+
dotnet package list [--config <SOURCE>]
18+
[--deprecated] [--project [<PROJECT>|<SOLUTION>]]
1919
[-f|--framework <FRAMEWORK>] [--highest-minor] [--highest-patch]
2020
[--include-prerelease] [--include-transitive] [--interactive]
2121
[--outdated] [--source <SOURCE>] [-v|--verbosity <LEVEL>]
2222
[--vulnerable]
2323
[--format <console|json>]
2424
[--output-version <VERSION>]
2525
26-
dotnet list package -h|--help
26+
dotnet package list -h|--help
2727
```
2828

2929
## Description
3030

31-
The `dotnet list package` command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process. The following example shows the output of the `dotnet list package` command for the [SentimentAnalysis](https://github.com/dotnet/samples/tree/main/machine-learning/tutorials/SentimentAnalysis) project:
31+
The `dotnet package list` command provides a convenient option to list all NuGet package references for a specific project or a solution. You first need to build the project in order to have the assets needed for this command to process. The following example shows the output of the `dotnet package list` command for the [SentimentAnalysis](https://github.com/dotnet/samples/tree/main/machine-learning/tutorials/SentimentAnalysis) project:
3232

3333
```output
3434
Project 'SentimentAnalysis' has the following package references
@@ -44,7 +44,7 @@ The **Requested** column refers to the package version specified in the project
4444

4545
Use the `--outdated` option to find out if there are newer versions available of the packages you're using in your projects. By default, `--outdated` lists the latest stable packages unless the resolved version is also a prerelease version. To include prerelease versions when listing newer versions, also specify the `--include-prerelease` option. To update a package to the latest version, use [dotnet add package](dotnet-add-package.md).
4646

47-
The following example shows the output of the `dotnet list package --outdated --include-prerelease` command for the same project as the previous example:
47+
The following example shows the output of the `dotnet package list --outdated --include-prerelease` command for the same project as the previous example:
4848

4949
```output
5050
The following sources were used:
@@ -57,7 +57,7 @@ Project `SentimentAnalysis` has the following updates to its packages
5757
> Microsoft.ML 1.4.0 1.4.0 1.5.0-preview
5858
```
5959

60-
If you need to find out whether your project has transitive dependencies, use the `--include-transitive` option. Transitive dependencies occur when you add a package to your project that in turn relies on another package. The following example shows the output from running the `dotnet list package --include-transitive` command for the [HelloPlugin](https://github.com/dotnet/samples/tree/main/core/extensions/AppWithPlugin/HelloPlugin) project, which displays top-level packages and the packages they depend on:
60+
If you need to find out whether your project has transitive dependencies, use the `--include-transitive` option. Transitive dependencies occur when you add a package to your project that in turn relies on another package. The following example shows the output from running the `dotnet package list --include-transitive` command for the [HelloPlugin](https://github.com/dotnet/samples/tree/main/core/extensions/AppWithPlugin/HelloPlugin) project, which displays top-level packages and the packages they depend on:
6161

6262
```output
6363
Project 'HelloPlugin' has the following package references
@@ -133,41 +133,41 @@ The project or solution file to operate on. If not specified, the command search
133133
- List package references of a specific project:
134134

135135
```dotnetcli
136-
dotnet list SentimentAnalysis.csproj package
136+
dotnet package list --project SentimentAnalysis.csproj
137137
```
138138

139139
- List package references that have newer versions available, including prerelease versions:
140140

141141
```dotnetcli
142-
dotnet list package --outdated --include-prerelease
142+
dotnet package list --outdated --include-prerelease
143143
```
144144

145145
- List package references for a specific target framework:
146146

147147
```dotnetcli
148-
dotnet list package --framework netcoreapp3.0
148+
dotnet package list --framework netcoreapp3.0
149149
```
150150

151151
- List package references in machine readable json output format:
152152

153153
```dotnetcli
154-
dotnet list package --format json
154+
dotnet package list --format json
155155
```
156156

157157
- List package references for a specific target framework in machine readable json output format:
158158

159159
```dotnetcli
160-
dotnet list package --framework netcoreapp3.0 --format json
160+
dotnet package list --framework netcoreapp3.0 --format json
161161
```
162162

163163
- Save machine readable json output of package references, including transitive dependency and vulnerability details into a file:
164164

165165
```dotnetcli
166-
dotnet list package --include-transitive --vulnerable --format json >> dependencyReport.json
166+
dotnet package list --include-transitive --vulnerable --format json >> dependencyReport.json
167167
```
168168

169169
- List package references in machine readable json output format with output version 1:
170170

171171
```dotnetcli
172-
dotnet list package --format json --output-version 1
172+
dotnet package list --format json --output-version 1
173173
```

docs/core/tools/dotnet-remove-package.md docs/core/tools/dotnet-package-remove.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
2-
title: dotnet remove package command
3-
description: The dotnet remove package command provides a convenient option to remove NuGet package reference to a project.
2+
title: dotnet package remove command
3+
description: The dotnet package remove command provides a convenient option to remove NuGet package reference to a project.
44
ms.date: 02/14/2020
55
---
6-
# dotnet remove package
6+
# dotnet package remove
77

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

1010
## Name
1111

12-
`dotnet remove package` - Removes package reference from a project file.
12+
`dotnet package remove` - Removes package reference from a project file.
1313

1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet remove [<PROJECT>] package <PACKAGE_NAME>
17+
dotnet package remove <PACKAGE_NAME> [--project <PROJECT>]
1818
19-
dotnet remove package -h|--help
19+
dotnet package remove -h|--help
2020
```
2121

2222
## Description
2323

24-
The `dotnet remove package` command provides a convenient option to remove a NuGet package reference from a project.
24+
The `dotnet package remove` command provides a convenient option to remove a NuGet package reference from a project.
2525

2626
## Arguments
2727

@@ -42,5 +42,5 @@ The package reference to remove.
4242
- Remove `Newtonsoft.Json` NuGet package from a project in the current directory:
4343

4444
```dotnetcli
45-
dotnet remove package Newtonsoft.Json
45+
dotnet package remove Newtonsoft.Json
4646
```

docs/core/tools/dotnet-add-reference.md docs/core/tools/dotnet-reference-add.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
---
2-
title: dotnet add reference command
3-
description: The dotnet add reference command provides a convenient option to add project-to-project references.
2+
title: dotnet reference add command
3+
description: The dotnet reference add command provides a convenient option to add project-to-project references.
44
ms.date: 03/21/2023
55
---
6-
# dotnet add reference
6+
# dotnet reference add
77

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

1010
## Name
1111

12-
`dotnet add reference` - Adds project-to-project (P2P) references.
12+
`dotnet reference add` - Adds project-to-project (P2P) references.
1313

1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet add [<PROJECT>] reference [-f|--framework <FRAMEWORK>]
18-
[--interactive] <PROJECT_REFERENCES>
17+
dotnet reference add reference [-f|--framework <FRAMEWORK>]
18+
[--interactive] <PROJECT_REFERENCES> [--project <PROJECT>]
1919
20-
dotnet add reference -h|--help
20+
dotnet reference add -h|--help
2121
```
2222

2323
## Description
2424

25-
The `dotnet add reference` command provides a convenient option to add project references to a project. After running the command, the `<ProjectReference>` elements are added to the project file.
25+
The `dotnet reference add` command provides a convenient option to add project references to a project. After running the command, the `<ProjectReference>` elements are added to the project file.
2626

2727
```xml
2828
<ItemGroup>
@@ -69,17 +69,17 @@ There's no CLI command to add a reference to an assembly that isn't in a project
6969
- Add a project reference:
7070

7171
```dotnetcli
72-
dotnet add app/app.csproj reference lib/lib.csproj
72+
dotnet reference add lib/lib.csproj --project app/app.csproj
7373
```
7474

7575
- Add multiple project references to the project in the current directory:
7676

7777
```dotnetcli
78-
dotnet add reference lib1/lib1.csproj lib2/lib2.csproj
78+
dotnet reference add lib1/lib1.csproj lib2/lib2.csproj
7979
```
8080

8181
- Add multiple project references using a globbing pattern on Linux/Unix:
8282

8383
```dotnetcli
84-
dotnet add app/app.csproj reference **/*.csproj
84+
dotnet reference add **/*.csproj --project app/app.csproj
8585
```
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
---
2-
title: dotnet list reference command
3-
description: The dotnet list reference command provides a convenient option to list project to project references.
2+
title: dotnet reference list command
3+
description: The dotnet reference list command provides a convenient option to list project to project references.
44
ms.date: 02/14/2020
55
---
6-
# dotnet list reference
6+
# dotnet reference list
77

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

1010
## Name
1111

12-
`dotnet list reference` - Lists project-to-project references.
12+
`dotnet reference list` - Lists project-to-project references.
1313

1414
## Synopsis
1515

1616
```dotnetcli
17-
dotnet list [<PROJECT>] reference
17+
dotnet reference list [--project <PROJECT>]
1818
19-
dotnet list -h|--help
19+
dotnet reference list -h|--help
2020
```
2121

2222
## Description
2323

24-
The `dotnet list reference` command provides a convenient option to list project references for a given project.
24+
The `dotnet reference list` command provides a convenient option to list project references for a given project.
2525

2626
## Arguments
2727

@@ -38,11 +38,11 @@ The `dotnet list reference` command provides a convenient option to list project
3838
* List the project references for the specified project:
3939

4040
```dotnetcli
41-
dotnet list app/app.csproj reference
41+
dotnet reference list --project app/app.csproj
4242
```
4343

4444
* List the project references for the project in the current directory:
4545

4646
```dotnetcli
47-
dotnet list reference
47+
dotnet reference list
4848
```

0 commit comments

Comments
 (0)