Skip to content

Commit d52c787

Browse files
authored
Add documentation for dotnet nuget config commands (#41019)
1 parent 6db182a commit d52c787

File tree

4 files changed

+228
-0
lines changed

4 files changed

+228
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: dotnet nuget config get command
3+
description: The dotnet-nuget-config command helps manage nuget configuration files.
4+
author: martinrrm
5+
ms.date: 05/14/2024
6+
---
7+
# dotnet nuget config get
8+
9+
**This article applies to:** ✔️ .NET 8.0.2xx SDK and later versions
10+
11+
## Name
12+
13+
`dotnet nuget config get` - Gets the NuGet configuration settings that will be applied.
14+
15+
## Synopsis
16+
17+
```dotnetcli
18+
dotnet nuget config get <ALL | CONFIG_KEY> [--show-path] [--working-directory <DIRECTORY>]
19+
20+
dotnet nuget config get -h|--help
21+
```
22+
23+
## Description
24+
25+
The `dotnet nuget config get` Gets the NuGet configuration settings that will be applied from the config section.
26+
27+
## Arguments
28+
29+
- **`ALL`**
30+
31+
Get all merged NuGet configuration settings from multiple NuGet configuration files that will be applied, when invoking NuGet command from the working directory path.
32+
33+
- **`CONFIG_KEY`**
34+
35+
Get the effective value of the specified configuration settings of the config section.
36+
37+
## Options
38+
39+
* **`--show-path`**
40+
41+
Indicate that the NuGet configuration file path will be shown beside the configuration settings.
42+
43+
* **`--working-directory <DIRECTORY>`**
44+
45+
Specifies the directory to start from when listing configuration files. If not specified, the current directory is used.
46+
47+
[!INCLUDE [help](../../../includes/cli-help.md)]
48+
49+
## Examples
50+
51+
* Lists all the Nuget configuration settings being applied to the current directory:
52+
53+
```dotnetcli
54+
dotnet nuget config get all
55+
```
56+
57+
* Lists the `repositoryPath` value from the config section being applied to the specified directory:
58+
59+
```dotnetcli
60+
dotnet nuget config get repositoryPath --working-directory "C:/working-directory"
61+
```
62+
63+
## See also
64+
65+
- [nuGet.config reference](/nuget/reference/nuget-config-file)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: dotnet nuget config paths command
3+
description: The dotnet-nuget-config command helps list nuget configuration files.
4+
author: martinrrm
5+
ms.date: 05/14/2024
6+
---
7+
# dotnet nuget config paths
8+
9+
**This article applies to:** ✔️ .NET 8.0.2xx SDK and later versions
10+
11+
## Name
12+
13+
`dotnet nuget config paths` - Lists nuget configuration files currently being appplied to a directory.
14+
15+
## Synopsis
16+
17+
```dotnetcli
18+
dotnet nuget config paths [--working-directory <DIRECTORY>]
19+
20+
dotnet nuget config paths -h|--help
21+
```
22+
23+
## Description
24+
25+
The `dotnet nuget config paths` Lists the paths to all NuGet configuration files that will be applied when invoking NuGet commands in a specific directory.
26+
27+
## Options
28+
29+
* **`--working-directory <DIRECTORY>`**
30+
31+
Specifies the directory to start from when listing configuration files. If not specified, the current directory is used.
32+
33+
[!INCLUDE [help](../../../includes/cli-help.md)]
34+
35+
## Examples
36+
37+
* Lists Nuget configuration files being applied to the current directory:
38+
39+
```dotnetcli
40+
dotnet nuget config paths
41+
```
42+
43+
* Lists Nuget configuration files being applied to the specified directory:
44+
45+
```dotnetcli
46+
dotnet nuget config paths --working-directory "C:/working-directory"
47+
```
48+
49+
## See also
50+
51+
- [nuGet.config reference](/nuget/reference/nuget-config-file)
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: dotnet nuget config set command
3+
description: The dotnet-nuget-config command helps manage nuget configuration files.
4+
author: martinrrm
5+
ms.date: 05/14/2024
6+
---
7+
# dotnet nuget config set
8+
9+
**This article applies to:** ✔️ .NET 8.0.2xx SDK and later versions
10+
11+
## Name
12+
13+
`dotnet nuget config set` - Set the value of a specified NuGet configuration setting.
14+
15+
## Synopsis
16+
17+
```dotnetcli
18+
dotnet nuget config set <CONFIG-KEY> <CONFIG-VALUE> [--configfile <FILE>]
19+
20+
dotnet nuget config set -h|--help
21+
```
22+
23+
## Description
24+
25+
The `dotnet nuget config set` sets the values for NuGet configuration settings that will be applied from the config section.
26+
27+
## Arguments
28+
29+
- **`CONFIG_KEY`**
30+
31+
The key of the settings that are to be set.
32+
33+
- **`CONFIG-VALUE`**
34+
35+
The value of the settings that are to be set.
36+
37+
## Options
38+
39+
- **`--configfile <FILE>`**
40+
41+
The NuGet configuration file (*nuget.config*) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see [Common NuGet Configurations](/nuget/consume-packages/configuring-nuget-behavior).
42+
43+
[!INCLUDE [help](../../../includes/cli-help.md)]
44+
45+
## Examples
46+
47+
* Sets the `repositoryPath` configuration value `c:\installed_packages` to the current directory:
48+
49+
```dotnetcli
50+
dotnet nuget config set repositoryPath "c:\installed_packages"
51+
```
52+
53+
* Sets the `repositoryPath` configuration value `c:\installed_packages` to the specified configuration file:
54+
55+
```dotnetcli
56+
dotnet nuget config set repositoryPath "c:\installed_packages" --configfile "C:/nugte.config"
57+
```
58+
59+
## See also
60+
61+
- [nuGet.config reference](/nuget/reference/nuget-config-file)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: dotnet nuget config unset command
3+
description: The dotnet-nuget-config command helps manage nuget configuration files.
4+
author: martinrrm
5+
ms.date: 05/14/2024
6+
---
7+
# dotnet nuget config unset
8+
9+
**This article applies to:** ✔️ .NET 8.0.2xx SDK and later versions
10+
11+
## Name
12+
13+
`dotnet nuget config unset` - Removes the key-value pair from a specified NuGet configuration setting.
14+
15+
## Synopsis
16+
17+
```dotnetcli
18+
dotnet nuget config unset <CONFIG-KEY> [--configfile <FILE>]
19+
20+
dotnet nuget config unset -h|--help
21+
```
22+
23+
## Description
24+
25+
The `dotnet nuget config unset` unsets the values for NuGet configuration settings that will be applied from the config section.
26+
27+
## Arguments
28+
29+
- **`CONFIG_KEY`**
30+
31+
The key of the settings that are to be removed.
32+
33+
## Options
34+
35+
- **`--configfile <FILE>`**
36+
37+
The NuGet configuration file (*nuget.config*) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see [Common NuGet Configurations](/nuget/consume-packages/configuring-nuget-behavior).
38+
39+
[!INCLUDE [help](../../../includes/cli-help.md)]
40+
41+
## Examples
42+
43+
* Removes's the `repositoryPath` config value from the specified configuration file:
44+
45+
```dotnetcli
46+
dotnet nuget config unset repositoryPath --configfile "C:/nugte.config"
47+
```
48+
49+
## See also
50+
51+
- [nuGet.config reference](/nuget/reference/nuget-config-file)

0 commit comments

Comments
 (0)