|
1 | 1 | ---
|
2 | 2 | title: dotnet tool install command
|
3 | 3 | description: The dotnet tool install command installs the specified .NET tool on your machine.
|
4 |
| -ms.date: 04/07/2025 |
| 4 | +ms.date: 08/27/2025 |
5 | 5 | ---
|
6 | 6 | # dotnet tool install
|
7 | 7 |
|
@@ -46,9 +46,9 @@ dotnet tool install -h|--help
|
46 | 46 |
|
47 | 47 | The `dotnet tool install` command provides a way for you to install .NET tools on your machine. To use the command, you specify one of the following installation options:
|
48 | 48 |
|
49 |
| -* To install a global tool in the default location, use the `--global` option. |
50 |
| -* To install a global tool in a custom location, use the `--tool-path` option. |
51 |
| -* To install a local tool, omit the `--global` and `--tool-path` options. |
| 49 | +- To install a global tool in the default location, use the `--global` option. |
| 50 | +- To install a global tool in a custom location, use the `--tool-path` option. |
| 51 | +- To install a local tool, omit the `--global` and `--tool-path` options. |
52 | 52 |
|
53 | 53 | > [!WARNING]
|
54 | 54 | > Make sure the directory you specify with the `--tool-path` option is secure. Tools installed in this location can be executed directly, so using an untrusted or shared path might introduce security risks.
|
@@ -80,7 +80,7 @@ Tools with explicit tool paths are stored wherever you specified the `--tool-pat
|
80 | 80 |
|
81 | 81 | Local tools are stored in the NuGet global directory, whatever you've set that to be. There are shim files in `$HOME/.dotnet/toolResolverCache` for each local tool that point to where the tools are within that location.
|
82 | 82 |
|
83 |
| -References to local tools are added to a *dotnet-tools.json* file in a *.config* directory under the current directory. If a manifest file doesn't exist yet, create it by using the `--create-manifest-if-needed` option or by running the following command: |
| 83 | +References to local tools are added to a *dotnet-tools.json* file in a *.config* directory under the current directory. Starting in .NET 10, if a manifest file doesn't exist yet, one is created automatically. You can also create one manually by running the following command: |
84 | 84 |
|
85 | 85 | ```dotnetcli
|
86 | 86 | dotnet new tool-manifest
|
@@ -112,19 +112,21 @@ For more information, see [Install a local tool](global-tools.md#install-a-local
|
112 | 112 |
|
113 | 113 | - **`--create-manifest-if-needed`**
|
114 | 114 |
|
115 |
| - Applies to local tools. Available starting with .NET 8 SDK. To find a manifest, the search algorithm searches up the directory tree for `dotnet-tools.json` or a `.config` folder that contains a `dotnet-tools.json` file. |
| 115 | + Available starting in .NET 8 SDK. |
116 | 116 |
|
117 |
| - If a tool-manifest can't be found and the `--create-manifest-if-needed` option is set to false, the `CannotFindAManifestFile` error occurs. |
| 117 | + Applies to local tools. To find a manifest, the search algorithm searches up the directory tree for `dotnet-tools.json` or a `.config` folder that contains a `dotnet-tools.json` file. |
118 | 118 |
|
119 |
| - If a tool-manifest can't be found and the `--create-manifest-if-needed` option is set to true, the tool creates a manifest automatically. It chooses a folder for the manifest as follows: |
| 119 | + If a tool-manifest can't be found and the `--create-manifest-if-needed` option is set to `false`, the `CannotFindAManifestFile` error occurs. |
120 | 120 |
|
121 |
| - * Walk up the directory tree searching for a directory that has a `.git` subfolder. If one is found, create the manifest in that directory. |
122 |
| - * If the previous step doesn't find a directory, walk up the directory tree searching for a directory that has a `.sln` or `.git` file. If one is found, create the manifest in that directory. |
123 |
| - * If neither of the previous two steps finds a directory, create the manifest in the current working directory. |
| 121 | + If a tool-manifest can't be found and the `--create-manifest-if-needed` option is set to `true` (or, in .NET 10 and later versions, when not specified), the tool creates a manifest automatically. It chooses a folder for the manifest as follows: |
| 122 | + |
| 123 | + - Walk up the directory tree searching for a directory that has a `.git` subfolder. If one is found, create the manifest in that directory. |
| 124 | + - If the previous step doesn't find a directory, walk up the directory tree searching for a directory that has a `.sln` or `.git` file. If one is found, create the manifest in that directory. |
| 125 | + - If neither of the previous two steps finds a directory, create the manifest in the current working directory. |
124 | 126 |
|
125 | 127 | For more information on how manifests are located, see [Install a local tool](global-tools.md#install-a-local-tool).
|
126 | 128 |
|
127 |
| - Starting in .NET 10, this flag is applied automatically if no tools manifest is found. |
| 129 | + Starting in .NET 10, a manifest is created automatically if no tools manifest is found. This change can be a [breaking change](../compatibility/sdk/10.0/dotnet-tool-install-local-manifest.md). You can opt out by passing `--create-manifest-if-needed=false`. |
128 | 130 |
|
129 | 131 | > [!WARNING]
|
130 | 132 | > Don't run tool commands from the **Downloads** folder or any shared location. The CLI walks up the directory tree to find a tool manifest, which might cause it to use a manifest you don't expect. Always run tool commands from a trusted, project-specific directory.
|
|
0 commit comments