Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

33
dotnet-add-package Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# dotnet add package
> Add or update a .NET package reference in a project file.
> More information: <https://learn.microsoft.com/dotnet/core/tools/dotnet-add-package>.
- Add a package to the project in the current directory:
`dotnet add package {{package}}`
- Add a package to a specific project:
`dotnet add {{path/to/file.csproj}} package {{package}}`
- Add a specific version of a package to the project:
`dotnet add package {{package}} --version {{1.0.0}}`
- Add a package using a specific NuGet source:
`dotnet add package {{package}} --source {{https://api.nuget.org/v3/index.json}}`
- Add a package only when targeting a specific framework:
`dotnet add package {{package}} --framework {{net7.0}}`
- Add and specify the directory where to restore packages (`~/.nuget/packages` by default):
`dotnet add package {{package}} --package-directory {{path/to/directory}}`