Skip to content

Commit 9a552da

Browse files
authored
Make it clear you can install multiple versions (#38919)
* Make it clear you can install multiple versions * more clarifications * fix link
1 parent 76decd9 commit 9a552da

File tree

5 files changed

+84
-44
lines changed

5 files changed

+84
-44
lines changed

docs/core/install/how-to-detect-installed-versions.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,20 @@ Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.Win
9595
::: zone pivot="os-linux"
9696

9797
```bash
98-
Microsoft.AspNetCore.All 2.1.7 [/home/user/dotnet/shared/Microsoft.AspNetCore.All]
99-
Microsoft.AspNetCore.All 2.1.13 [/home/user/dotnet/shared/Microsoft.AspNetCore.All]
100-
Microsoft.AspNetCore.App 2.1.7 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
101-
Microsoft.AspNetCore.App 2.1.13 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
102-
Microsoft.AspNetCore.App 3.1.0 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
103-
Microsoft.AspNetCore.App 5.0.0 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
104-
Microsoft.AspNetCore.App 6.0.0 [/home/user/dotnet/shared/Microsoft.AspNetCore.App]
105-
Microsoft.NETCore.App 2.1.7 [/home/user/dotnet/shared/Microsoft.NETCore.App]
106-
Microsoft.NETCore.App 2.1.13 [/home/user/dotnet/shared/Microsoft.NETCore.App]
107-
Microsoft.NETCore.App 3.1.0 [/home/user/dotnet/shared/Microsoft.NETCore.App]
108-
Microsoft.NETCore.App 5.0.0 [/home/user/dotnet/shared/Microsoft.NETCore.App]
109-
Microsoft.NETCore.App 6.0.0 [/home/user/dotnet/shared/Microsoft.NETCore.App]
110-
Microsoft.NETCore.App 7.0.0 [/home/user/dotnet/shared/Microsoft.NETCore.App]
111-
Microsoft.NETCore.App 8.0.0 [/home/user/dotnet/shared/Microsoft.NETCore.App]
98+
Microsoft.AspNetCore.All 2.1.7 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.All]
99+
Microsoft.AspNetCore.All 2.1.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.All]
100+
Microsoft.AspNetCore.App 2.1.7 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
101+
Microsoft.AspNetCore.App 2.1.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
102+
Microsoft.AspNetCore.App 3.1.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
103+
Microsoft.AspNetCore.App 5.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
104+
Microsoft.AspNetCore.App 6.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
105+
Microsoft.NETCore.App 2.1.7 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
106+
Microsoft.NETCore.App 2.1.13 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
107+
Microsoft.NETCore.App 3.1.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
108+
Microsoft.NETCore.App 5.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
109+
Microsoft.NETCore.App 6.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
110+
Microsoft.NETCore.App 7.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
111+
Microsoft.NETCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
112112
```
113113

114114
::: zone-end
@@ -156,13 +156,19 @@ _C:\\program files\\dotnet\\shared\\{runtime-type}\\{version}\\_
156156
::: zone pivot="os-linux"
157157

158158
- **dotnet executable**\
159-
_/home/user/share/dotnet/dotnet_
159+
_/home/user/.dotnet/dotnet_\
160+
_/usr/lib/dotnet/dotnet_\
161+
_/usr/share/dotnet/dotnet_\
160162

161163
- **.NET SDK**\
162-
_/home/user/share/dotnet/sdk/{version}/_
164+
_/home/user/.dotnet/sdk/{version}/_\
165+
_/usr/lib/dotnet/sdk/{version}/_\
166+
_/usr/share/dotnet/sdk/{version}/_\
163167

164168
- **.NET Runtime**\
165-
_/home/user/share/dotnet/shared/{runtime-type}/{version}/_
169+
_/home/user/.dotnet/shared/{runtime-type}/{version}/_\
170+
_/usr/lib/dotnet/shared/{runtime-type}/{version}/_\
171+
_/usr/share/dotnet/shared/{runtime-type}/{version}/_\
166172

167173
::: zone-end
168174

docs/core/install/linux-scripted-manual.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ Different versions of .NET can be extracted to the same folder, which coexist si
131131

132132
### Example
133133

134-
The following commands set the environment variable `DOTNET_ROOT` to the current working directory followed by `.dotnet`. They then create the directory if it doesn't exist and extract the contents of the file specified by the `DOTNET_FILE` environment variable to the `.dotnet` directory. Both the `.dotnet` directory and its `tools` subdirectory are added to the `PATH` environment variable.
134+
<!-- Note, this content is copied in macos.md. Any fixes should be applied there too, though content may be different -->
135+
136+
The following commands use Bash to set the environment variable `DOTNET_ROOT` to the current working directory followed by `.dotnet`. That directory is created if it doesn't exist. The `DOTNET_FILE` environment variable is the filename of the .NET binary release you want to install. This file is extracted to the `DOTNET_ROOT` directory. Both the `DOTNET_ROOT` directory and its `tools` subdirectory are added to the `PATH` environment variable.
135137

136138
> [!IMPORTANT]
137139
> If you run these commands, remember to change the `DOTNET_FILE` value to the name of the .NET binary you downloaded.
@@ -145,7 +147,13 @@ mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
145147
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
146148
```
147149

148-
The preceding install script approach allows installing different versions into separate locations so you can choose explicitly which one to use by which app. However, you can still install multiple versions of .NET to the same folder.
150+
You can install more than one version of .NET in the same folder.
151+
152+
You can also install .NET to the home directory identified by the `HOME` variable or `~` path:
153+
154+
```bash
155+
export DOTNET_ROOT=$HOME/.dotnet
156+
```
149157

150158
## Verify downloaded binaries
151159

@@ -157,7 +165,7 @@ The preceding install script approach allows installing different versions into
157165

158166
If you used the previous install script, the variables set only apply to your current terminal session. Add them to your shell profile. There are many different shells available for Linux and each has a different profile. For example:
159167

160-
- **Bash Shell**: *~/.bash_profile*, *~/.bashrc*
168+
- **Bash Shell**: *~/.bash_profile* or *~/.bashrc*
161169
- **Korn Shell**: *~/.kshrc* or *.profile*
162170
- **Z Shell**: *~/.zshrc* or *.zprofile*
163171

@@ -173,7 +181,7 @@ Set the following two environment variables in your shell profile:
173181

174182
- `PATH`
175183

176-
This variable should include both the `DOTNET_ROOT` folder and the user's _.dotnet/tools_ folder:
184+
This variable should include both the `DOTNET_ROOT` folder and the `DOTNET_ROOT/tools` folder:
177185

178186
```bash
179187
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools

docs/core/install/macos-notarization-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Beginning with macOS Catalina (version 10.15), all software built after June 1,
1212

1313
## Installing .NET
1414

15-
The installers for .NET (both runtime and SDK) have been notarized since February 18, 2020. Prior released versions aren't notarized. You can manually install a non-notarized version of .NET by first downloading the installer, and then using the `sudo installer` command. For more information, see [Download and manually install for macOS](./macos.md#download-and-manually-install).
15+
The installers for .NET (both runtime and SDK) have been notarized since February 18, 2020. Prior released versions aren't notarized. You can manually install a non-notarized version of .NET by first downloading the installer, and then using the `sudo installer` command. For more information, see [Download and manually install for macOS](./macos.md#manual-install).
1616

1717
## Native appHost
1818

docs/core/install/macos.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,61 +81,87 @@ brew update
8181
brew install mono-libgdiplus
8282
```
8383

84-
## Install with an installer
84+
## Automated install
8585

8686
macOS has standalone installers that can be used to install .NET:
8787

8888
- ✔️ [.NET 8 downloads](https://dotnet.microsoft.com/download/dotnet/8.0)
8989
- ✔️ [.NET 7 downloads](https://dotnet.microsoft.com/download/dotnet/7.0)
9090
- ✔️ [.NET 6 downloads](https://dotnet.microsoft.com/download/dotnet/6.0)
9191

92-
## Download and manually install
92+
## Manual install
9393

9494
<!-- Note, this content is taken from linux-scripted-manual.md but changed for macOS. Any fixes should be applied there too, though content may be different -->
9595

9696
As an alternative to the macOS installers for .NET, you can download and manually install the SDK and runtime. Manual installation is usually performed as part of continuous integration testing. For a developer or user, it's generally better to use an [installer](https://dotnet.microsoft.com/download/dotnet).
9797

98-
First, download a **binary** release for either the SDK or the runtime from one of the following sites. If you install the .NET SDK, you won't need to install the corresponding runtime:
98+
Download a **binary** release for either the SDK or the runtime from one of the following sites. The .NET SDK includes the corresponding runtime:
9999

100100
- ✔️ [.NET 8 downloads](https://dotnet.microsoft.com/download/dotnet/8.0)
101101
- ✔️ [.NET 7 downloads](https://dotnet.microsoft.com/download/dotnet/7.0)
102102
- ✔️ [.NET 6 downloads](https://dotnet.microsoft.com/download/dotnet/6.0)
103103
- [All .NET downloads](https://dotnet.microsoft.com/download/dotnet)
104104

105-
Next, extract the downloaded file and use the `export` command to set `DOTNET_ROOT` to the extracted folder's location and then ensure .NET is in PATH. This should make the .NET CLI commands available at the terminal. For more information about .NET environment variables, see [.NET SDK and CLI environment variables](../tools/dotnet-environment-variables.md#net-sdk-and-cli-environment-variables).
105+
Extract the downloaded file and use the `export` command to set `DOTNET_ROOT` to the extracted folder's location and then ensure .NET is in PATH. Exporting `DOTNET_ROOT` makes the .NET CLI commands available in the terminal. For more information about .NET environment variables, see [.NET SDK and CLI environment variables](../tools/dotnet-environment-variables.md#net-sdk-and-cli-environment-variables).
106106

107-
Alternatively, after downloading the .NET binary, the following commands can be run from the directory where the file is saved to extract the runtime. These commands also make the .NET CLI commands available at the terminal and set the required environment variables. **Remember to change the `DOTNET_FILE` value to the name of the downloaded binary**:
107+
Different versions of .NET can be extracted to the same folder, which coexist side-by-side.
108+
109+
### Example
110+
111+
The following commands use Bash to set the environment variable `DOTNET_ROOT` to the current working directory followed by `.dotnet`. That directory is created if it doesn't exist. The `DOTNET_FILE` environment variable is the filename of the .NET binary release you want to install. This file is extracted to the `DOTNET_ROOT` directory. Both the `DOTNET_ROOT` directory and its `tools` subdirectory are added to the `PATH` environment variable.
112+
113+
> [!IMPORTANT]
114+
> If you run these commands, remember to change the `DOTNET_FILE` value to the name of the .NET binary you downloaded.
108115
109116
```bash
110117
DOTNET_FILE=dotnet-sdk-8.0.100-osx-x64.tar.gz
111-
export DOTNET_ROOT=$(pwd)/dotnet
118+
export DOTNET_ROOT=$(pwd)/.dotnet
112119

113120
mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"
114121

115122
export PATH=$PATH:$DOTNET_ROOT
116123
```
117124

118-
> [!TIP]
119-
> The preceding `export` commands only make the .NET CLI commands available for the terminal session in which it was run.
120-
>
121-
> You can edit your shell profile to permanently add the commands. There are a number of different shells available for Linux and each has a different profile. For example:
122-
>
123-
> - **Bash Shell**: *~/.bash_profile*, *~/.bashrc*
124-
> - **Korn Shell**: *~/.kshrc* or *.profile*
125-
> - **Z Shell**: *~/.zshrc* or *.zprofile*
126-
>
127-
> Edit the appropriate source file for your shell and add `:$HOME/dotnet` to the end of the existing `PATH` statement. If no `PATH` statement is included, add a new line with `export PATH=$PATH:$HOME/dotnet`.
128-
>
129-
> Also, add `export DOTNET_ROOT=$HOME/dotnet` to the end of the file.
125+
You can install more than one version of .NET in the same folder.
126+
127+
You can also install .NET to the home directory identified by the `HOME` variable or `~` path:
130128

131-
This approach lets you install different versions into separate locations and choose explicitly which one to use by which application.
129+
```bash
130+
export DOTNET_ROOT=$HOME/.dotnet
131+
```
132132

133133
## Verify downloaded binaries
134134

135135
[!INCLUDE [verify-download-intro](includes/verify-download-intro.md)]
136136

137137
[!INCLUDE [verify-download-macos-linux](includes/verify-download-macos-linux.md)]
138138

139+
## Set environment variables system-wide
140+
141+
If you used the instructions in the [Manual install example](#example) section, the variables set only apply to your current terminal session. Add them to your shell profile. There are many different shells available for macOS and each has a different profile. For example:
142+
143+
- **Bash Shell**: *~/.profile*, */etc/profile*
144+
- **Korn Shell**: *~/.kshrc* or *.profile*
145+
- **Z Shell**: *~/.zshrc* or *.zprofile*
146+
147+
Set the following two environment variables in your shell profile:
148+
149+
- `DOTNET_ROOT`
150+
151+
This variable is set to the folder .NET was installed to, such as `$HOME/.dotnet`:
152+
153+
```bash
154+
export DOTNET_ROOT=$HOME/.dotnet
155+
```
156+
157+
- `PATH`
158+
159+
This variable should include both the `DOTNET_ROOT` folder and the `DOTNET_ROOT/tools` folder:
160+
161+
```bash
162+
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
163+
```
164+
139165
## Arm-based Macs
140166

141167
The following sections describe things you should consider when installing .NET on an Arm-based Mac.

docs/core/runtime-discovery/troubleshoot-app-launch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,15 @@ For more information on installation using the script, see [Install with bash au
240240
You can download a binary archive of .NET from the [download page](https://dotnet.microsoft.com/download/dotnet). From the **Binaries** column of the runtime download, download the binary release matching the required architecture. Extract the downloaded archive to the ".NET location" specified in the error message.
241241

242242
::: zone pivot="os-windows"
243-
For more details on manual installation, see [Install .NET on Windows](../install/windows.md#install-with-powershell-automation)
243+
For more information about manual installation, see [Install .NET on Windows](../install/windows.md#install-with-powershell-automation)
244244
::: zone-end
245245

246246
::: zone pivot="os-linux"
247-
For more details on manual installation, see [Install .NET on Linux](../install/linux.md#manual-installation)
247+
For more information about manual installation, see [Install .NET on Linux](../install/linux.md#manual-installation)
248248
::: zone-end
249249

250250
::: zone pivot="os-macos"
251-
For more details on manual installation, see [Install .NET on macOS](../install/macos.md#download-and-manually-install)
251+
For more information about manual installation, see [Install .NET on macOS](../install/macos.md#manual-install)
252252
::: zone-end
253253

254254
### Configure roll-forward behavior

0 commit comments

Comments
 (0)