Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from dotnet verb noun to dotnet noun verb #43917

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---
title: dotnet add package command
description: The 'dotnet add package' command provides a convenient option to add a NuGet package reference to a project.
title: dotnet package add command
description: The 'dotnet package add' command provides a convenient option to add a NuGet package reference to a project.
ms.date: 04/13/2022
---
# dotnet add package
# dotnet package add

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

## Name

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

## Synopsis

```dotnetcli
dotnet add [<PROJECT>] package <PACKAGE_NAME>
[-f|--framework <FRAMEWORK>] [--interactive]
dotnet package add <PACKAGE_NAME>
[-f|--framework <FRAMEWORK>] [--interactive] [--project <PROJECT>]
[-n|--no-restore] [--package-directory <PACKAGE_DIRECTORY>]
[--prerelease] [-s|--source <SOURCE>] [-v|--version <VERSION>]

dotnet add package -h|--help
dotnet package add -h|--help
```

## Description

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.
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.

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

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

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.

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

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

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

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.

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

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

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

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.

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

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

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

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.

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

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

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

```dotnetcli
dotnet add package Microsoft.EntityFrameworkCore
dotnet package add Microsoft.EntityFrameworkCore
```

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

```dotnetcli
dotnet add ToDo.csproj package Microsoft.Azure.DocumentDB.Core -v 1.0.0
dotnet package add Microsoft.Azure.DocumentDB.Core -v 1.0.0 --project ToDo.csproj
```

- Add a package using a specific NuGet source:

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

## See also
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
title: dotnet list package command
description: The 'dotnet list package' command provides a convenient option to list the package references for a project or solution.
title: dotnet package list command
description: The 'dotnet package list' command provides a convenient option to list the package references for a project or solution.
ms.date: 04/13/2022
---
# dotnet list package
# dotnet package list

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

## Name

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

## Synopsis

```dotnetcli
dotnet list [<PROJECT>|<SOLUTION>] package [--config <SOURCE>]
[--deprecated]
dotnet package list [--config <SOURCE>]
[--deprecated] [--project [<PROJECT>|<SOLUTION>]]
[-f|--framework <FRAMEWORK>] [--highest-minor] [--highest-patch]
[--include-prerelease] [--include-transitive] [--interactive]
[--outdated] [--source <SOURCE>] [-v|--verbosity <LEVEL>]
[--vulnerable]
[--format <console|json>]
[--output-version <VERSION>]

dotnet list package -h|--help
dotnet package list -h|--help
```

## Description

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:
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:

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

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).

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

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

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:
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:

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

```dotnetcli
dotnet list SentimentAnalysis.csproj package
dotnet package list --project SentimentAnalysis.csproj
```

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

```dotnetcli
dotnet list package --outdated --include-prerelease
dotnet package list --outdated --include-prerelease
```

- List package references for a specific target framework:

```dotnetcli
dotnet list package --framework netcoreapp3.0
dotnet package list --framework netcoreapp3.0
```

- List package references in machine readable json output format:

```dotnetcli
dotnet list package --format json
dotnet package list --format json
```

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

```dotnetcli
dotnet list package --framework netcoreapp3.0 --format json
dotnet package list --framework netcoreapp3.0 --format json
```

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

```dotnetcli
dotnet list package --include-transitive --vulnerable --format json >> dependencyReport.json
dotnet package list --include-transitive --vulnerable --format json >> dependencyReport.json
```

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

```dotnetcli
dotnet list package --format json --output-version 1
dotnet package list --format json --output-version 1
```
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
title: dotnet remove package command
description: The dotnet remove package command provides a convenient option to remove NuGet package reference to a project.
title: dotnet package remove command
description: The dotnet package remove command provides a convenient option to remove NuGet package reference to a project.
ms.date: 02/14/2020
---
# dotnet remove package
# dotnet package remove

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

## Name

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

## Synopsis

```dotnetcli
dotnet remove [<PROJECT>] package <PACKAGE_NAME>
dotnet package remove <PACKAGE_NAME> [--project <PROJECT>]

dotnet remove package -h|--help
dotnet package remove -h|--help
```

## Description

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

## Arguments

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

```dotnetcli
dotnet remove package Newtonsoft.Json
dotnet package remove Newtonsoft.Json
```
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
title: dotnet add reference command
description: The dotnet add reference command provides a convenient option to add project-to-project references.
title: dotnet reference add command
description: The dotnet reference add command provides a convenient option to add project-to-project references.
ms.date: 03/21/2023
---
# dotnet add reference
# dotnet reference add

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

## Name

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

## Synopsis

```dotnetcli
dotnet add [<PROJECT>] reference [-f|--framework <FRAMEWORK>]
[--interactive] <PROJECT_REFERENCES>
dotnet reference add reference [-f|--framework <FRAMEWORK>]
[--interactive] <PROJECT_REFERENCES> [--project <PROJECT>]

dotnet add reference -h|--help
dotnet reference add -h|--help
```

## Description

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.
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.

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

```dotnetcli
dotnet add app/app.csproj reference lib/lib.csproj
dotnet reference add lib/lib.csproj --project app/app.csproj
```

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

```dotnetcli
dotnet add reference lib1/lib1.csproj lib2/lib2.csproj
dotnet reference add lib1/lib1.csproj lib2/lib2.csproj
```

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

```dotnetcli
dotnet add app/app.csproj reference **/*.csproj
dotnet reference add **/*.csproj --project app/app.csproj
```
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
---
title: dotnet list reference command
description: The dotnet list reference command provides a convenient option to list project to project references.
title: dotnet reference list command
description: The dotnet reference list command provides a convenient option to list project to project references.
ms.date: 02/14/2020
---
# dotnet list reference
# dotnet reference list

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

## Name

`dotnet list reference` - Lists project-to-project references.
`dotnet reference list` - Lists project-to-project references.

## Synopsis

```dotnetcli
dotnet list [<PROJECT>] reference
dotnet reference list [--project <PROJECT>]

dotnet list -h|--help
dotnet reference list -h|--help
```

## Description

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

## Arguments

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

```dotnetcli
dotnet list app/app.csproj reference
dotnet reference list --project app/app.csproj
```

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

```dotnetcli
dotnet list reference
dotnet reference list
```
Loading
Loading