|
| 1 | +--- |
| 2 | +title: dotnet-core-uninstall dry-run command |
| 3 | +description: The dotnet-core-uninstall dry-run command simulates uninstalling the target .NET SDK or runtime. Status is reported for potential removal. |
| 4 | +author: adegeo |
| 5 | +ms.date: 08/04/2024 |
| 6 | +zone_pivot_groups: operating-systems-set-three |
| 7 | +--- |
| 8 | + |
| 9 | +# dotnet-core-uninstall dry-run |
| 10 | + |
| 11 | +**This article applies to:** ✔️ .NET Uninstall Tool 1.7.521001 and later versions |
| 12 | + |
| 13 | +## Name |
| 14 | + |
| 15 | +`dotnet-core-uninstall dry-run` - Display .NET SDKs and Runtimes that will be removed. |
| 16 | + |
| 17 | +> [!TIP] |
| 18 | +> The `dotnet-core-uninstall whatif` command is the same command as `dry-run`. |
| 19 | +
|
| 20 | +## Synopsis |
| 21 | + |
| 22 | +::: zone pivot="os-windows" |
| 23 | + |
| 24 | +```dotnetcli |
| 25 | +dotnet-core-uninstall dry-run <TARGET> [--x64|--x86] <VERSION>... |
| 26 | + [-v|--verbosity <LEVEL>] [--force] |
| 27 | +
|
| 28 | +dotnet-core-uninstall dry-run <TARGET> [--x64|--x86] <FILTER> |
| 29 | + [-v|--verbosity <LEVEL>] |
| 30 | +
|
| 31 | +dotnet-core-uninstall dry-run -h|--help|-? |
| 32 | +``` |
| 33 | + |
| 34 | +::: zone-end |
| 35 | + |
| 36 | +::: zone pivot="os-macos" |
| 37 | + |
| 38 | +```dotnetcli |
| 39 | +dotnet-core-uninstall dry-run <TARGET> <VERSION>... |
| 40 | + [-v|--verbosity <LEVEL>] [--force] [-y|--yes] |
| 41 | +
|
| 42 | +dotnet-core-uninstall dry-run <TARGET> <FILTER> |
| 43 | + [-v|--verbosity <LEVEL>] [--force] [-y|--yes] |
| 44 | +
|
| 45 | +dotnet-core-uninstall dry-run -h|--help|-? |
| 46 | +``` |
| 47 | + |
| 48 | +::: zone-end |
| 49 | + |
| 50 | +## Description |
| 51 | + |
| 52 | +The `dotnet-core-uninstall list` command simulates .NET SDK and runtime removal. A status output is provided for each .NET SDK and runtime that would have been removed by the tool. |
| 53 | + |
| 54 | +### Arguments |
| 55 | + |
| 56 | +**`TARGET`** |
| 57 | + |
| 58 | + The type you want to uninstall. Valid options are listed in the [Options - TARGET](#options---target) section. |
| 59 | + |
| 60 | +**`VERSION`** |
| 61 | + |
| 62 | + The version to uninstall. You can list several versions separated by a space. Response files are also supported. |
| 63 | + |
| 64 | + > [!TIP] |
| 65 | + > Response files are an alternative to placing all the versions on the command line. They're text files, typically with a *\*.rsp* extension, and each version is listed on a separate line. To specify a response file for the `VERSION` argument, use the \@ character immediately followed by the response file name. |
| 66 | +
|
| 67 | +**`FILTER`** |
| 68 | + |
| 69 | + Specifies a value used to filter the `TARGET`. Valid options are listed in the [Options - FILTER](#options---filter) section. |
| 70 | + |
| 71 | +## Options - TARGET |
| 72 | + |
| 73 | +::: zone pivot="os-windows" |
| 74 | + |
| 75 | +- **`--aspnet-runtime`** |
| 76 | + |
| 77 | + Discovers all the ASP.NET Core runtimes that can be uninstalled with this tool. |
| 78 | + |
| 79 | +- **`--hosting-bundle`** |
| 80 | + |
| 81 | + Lists all the .NET hosting bundles that can be uninstalled with this tool. |
| 82 | + |
| 83 | +::: zone-end |
| 84 | + |
| 85 | +- **`--runtime`** |
| 86 | + |
| 87 | + Lists all the .NET runtimes that can be uninstalled with this tool. |
| 88 | + |
| 89 | +- **`--sdk`** |
| 90 | + |
| 91 | + Lists all the .NET SDKs that can be uninstalled with this tool. |
| 92 | + |
| 93 | +::: zone pivot="os-windows" |
| 94 | + |
| 95 | +- **`--x64`** |
| 96 | + |
| 97 | + Lists all the x64 .NET SDKs and runtimes that can be uninstalled with this tool. |
| 98 | + |
| 99 | + > [!NOTE] |
| 100 | + > If `--x64` or `--x86` isn't specified, then both x64 and x86 will be removed. |
| 101 | +
|
| 102 | +- **`--x86`** |
| 103 | + |
| 104 | + Lists all the x86 .NET SDKs and runtimes that can be uninstalled with this tool. |
| 105 | + |
| 106 | + > [!NOTE] |
| 107 | + > If `--x64` or `--x86` isn't specified, then both x64 and x86 will be removed. |
| 108 | +
|
| 109 | +::: zone-end |
| 110 | + |
| 111 | +## Options - FILTER |
| 112 | + |
| 113 | +These options are exclusive. |
| 114 | + |
| 115 | +- **`--all`** |
| 116 | + |
| 117 | + Removes all the .NET SDKs and runtimes. |
| 118 | + |
| 119 | +- **`--all-below <VERSION>[ <VERSION>...]`** |
| 120 | + |
| 121 | + Removes only the .NET SDKs and runtimes with a version smaller than the specified version. The specified version remains installed. |
| 122 | + |
| 123 | +- **`--all-but <VERSION>[ <VERSION>...]`** |
| 124 | + |
| 125 | + Removes all the .NET SDKs and runtimes, except those versions specified. |
| 126 | + |
| 127 | +- **`--all-but-latest`** |
| 128 | + |
| 129 | + Removes the .NET SDKs and runtimes, except the highest version. |
| 130 | + |
| 131 | +- **`--all-lower-patches`** |
| 132 | + |
| 133 | + Removes the .NET SDKs and runtimes superseded by higher patches. This option protects _global.json_ file. |
| 134 | + |
| 135 | +- **`--all-previews`** |
| 136 | + |
| 137 | + Removes the .NET SDKs and runtimes marked as previews. |
| 138 | + |
| 139 | +- **`--all-previews-but-latest`** |
| 140 | + |
| 141 | + Removes the .NET SDKs and runtimes marked as previews except the highest preview. |
| 142 | + |
| 143 | +- **`--major-minor <MAJOR_MINOR>`** |
| 144 | + |
| 145 | + Removes the .NET SDKs and runtimes that match the specified `major.minor` version. |
| 146 | + |
| 147 | +## Options |
| 148 | + |
| 149 | +- **`--force`** |
| 150 | + |
| 151 | + Forces removal of versions that might be used by Visual Studio. |
| 152 | + |
| 153 | +- **`-v, --verbosity <LEVEL>`** |
| 154 | + |
| 155 | + Sets the verbosity level. The default value is `normal`. Allowed values are: |
| 156 | + |
| 157 | + - `q[uiet]` |
| 158 | + - `m[inimal]` |
| 159 | + - `n[ormal]` |
| 160 | + - `d[etailed]` |
| 161 | + - `diag[nostic]`. |
| 162 | + |
| 163 | +- **`-?|-h|--help`** |
| 164 | + |
| 165 | + Shows help and usage information |
| 166 | + |
| 167 | +> [!NOTE] |
| 168 | +> By default, .NET SDKs and runtimes that might be required by Visual Studio or other SDKs aren't included in the `dotnet-core-uninstall dry-run` output. Also, depending on the state of the machine, some of the specified SDKs and runtimes might not be included in the output. To include all the SDKs and runtimes, list them explicitly as arguments or use the `--force` option. |
| 169 | +
|
| 170 | +- Dry run of removing all the .NET runtimes that have been superseded by higher patches: |
| 171 | + |
| 172 | + ```console |
| 173 | + dotnet-core-uninstall dry-run --all-lower-patches --runtime |
| 174 | + ``` |
| 175 | + |
| 176 | +- Dry run of removing all the .NET SDKs below the version `6.0.301`: |
| 177 | + |
| 178 | + ```console |
| 179 | + dotnet-core-uninstall whatif --all-below 6.0.301 --sdk |
| 180 | + ``` |
| 181 | + |
| 182 | + > [!TIP] |
| 183 | + > The `dotnet-core-uninstall whatif` command is the same command as `dry-run`. |
| 184 | +
|
| 185 | +## See also |
| 186 | + |
| 187 | +- [.NET uninstall tool overview](uninstall-tool-overview.md) |
| 188 | +- [dotnet-core-uninstall list](uninstall-tool-cli-list.md) |
| 189 | +- [dotnet-core-uninstall remove](uninstall-tool-cli-remove.md) |
0 commit comments