To find the installed .NET versions on your system, you can use a few different methods, depending on your operating system.
1. Using the Command Line (Cross-Platform)
The .NET
CLI provides a command that will list all the installed SDKs and runtimes.
Step-by-Step:
- Open a terminal or command prompt.
- On Windows, open Command Prompt or PowerShell.
- On Linux/Mac, open your terminal.
- Run the following command:
dotnet --list-sdks
This command lists all the installed .NET SDK versions.
Example output:
3.1.414 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk] 6.0.100 [C:\Program Files\dotnet\sdk]
- To check the installed runtimes, you can use the following command:
dotnet --list-runtimes
This will display the installed .NET runtimes on your machine.
Example output:
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2. Using dotnet --version
If you want to check the current version of the dotnet
CLI, run:
dotnet --version
This will return the version of the currently active SDK.
3. Windows (Control Panel or Registry)
If you’re on Windows and want to check the installed .NET versions manually without using the CLI:
- Control Panel:
- Go to Control Panel → Programs → Programs and Features.
- Look for entries that start with
.NET
or.NET Framework
. You can find installed .NET Framework versions here.
- Registry (for more advanced users):
- Open the Registry Editor (
regedit
). - Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
- Here, you can see different versions of the .NET Framework installed on your machine.
- Open the Registry Editor (
4. macOS/Linux (File System Location)
On macOS or Linux, you can check the typical installation paths for the .NET SDK and runtime.
- SDKs:
- Look in the directory
/usr/local/share/dotnet/sdk
(for Linux/Mac).
You can use the
ls
command to list the SDK versions:ls /usr/local/share/dotnet/sdk
- Look in the directory
- Runtimes:
- The runtimes are typically located in
/usr/local/share/dotnet/shared
.
To list installed runtimes:
ls /usr/local/share/dotnet/shared
- The runtimes are typically located in
Â
- Cross-Platform: Use
dotnet --list-sdks
anddotnet --list-runtimes
to list installed SDKs and runtimes. - Windows: Check
Programs and Features
or use the Registry Editor. - macOS/Linux: Check the typical file paths (
/usr/local/share/dotnet
).
These methods will help you identify the versions of .NET SDKs and runtimes installed on your system.