How do I find the installed .NET versions?
Categories:
How to Find Installed .NET Versions on Your System
This article provides comprehensive methods to identify all installed .NET runtime and SDK versions on Windows, macOS, and Linux, including command-line tools, environment variables, and file system checks.
Understanding which .NET versions are installed on your system is crucial for development, deployment, and troubleshooting. Whether you're a developer ensuring compatibility, an administrator managing server environments, or simply curious, this guide will walk you through various reliable methods to accurately determine the .NET versions present on your machine. We will cover command-line utilities, file system inspections, and platform-specific approaches for Windows, macOS, and Linux.
Using the .NET Command-Line Interface (CLI)
The .NET CLI is the most straightforward and recommended method to check installed .NET SDKs and runtimes. It's cross-platform and provides detailed information about your .NET environment. If you have the .NET SDK installed, you can use simple commands to list all available versions.
dotnet --list-sdks
This command lists all installed .NET SDKs, showing their version and installation path.
dotnet --list-runtimes
This command displays all installed .NET runtimes, including their version, architecture, and installation path.
dotnet
command is not recognized, it means the .NET SDK is not installed or not added to your system's PATH environment variable. You might need to install the SDK or manually locate the dotnet
executable.Checking the File System Directly
Even without the dotnet
CLI, you can often infer installed .NET versions by examining standard installation directories. .NET runtimes and SDKs are typically installed in well-known locations on each operating system.
On Windows, .NET Core and .NET 5+ are usually found under C:\Program Files\dotnet\
for 64-bit systems. Within this directory, you'll find sdk
and shared
subdirectories, which contain folders named after the version numbers. For older .NET Framework versions, you'll need to check the Global Assembly Cache (GAC) or specific framework directories.
Example of .NET runtime versions found in the Windows file system.
On macOS and Linux, the default installation path is typically /usr/local/share/dotnet/
. Similar to Windows, you'll find sdk
and shared
subdirectories containing version-specific folders.
ls /usr/local/share/dotnet/shared/Microsoft.NETCore.App
Lists the installed .NET Core/5+ runtimes in the default Linux/macOS path.
Platform-Specific Methods
Beyond the universal CLI and file system checks, each operating system offers specific ways to identify installed software, including .NET components.
1. Step 1
Windows (Add or Remove Programs): Open 'Add or Remove Programs' (or 'Apps & features' in Windows 10/11) from the Control Panel or Settings. Search for ".NET" to see a list of installed .NET SDKs, runtimes, and sometimes older .NET Framework versions.
2. Step 2
Windows (Registry Editor for .NET Framework): For .NET Framework versions (up to 4.8), you can check the Windows Registry. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
. Each subkey represents a .NET Framework version.
3. Step 3
macOS (System Information): While less common for .NET Core/5+, you can sometimes find installed packages via System Information utilities, though the dotnet CLI
is usually more reliable.
4. Step 4
Linux (Package Manager): Depending on your Linux distribution, you can use your package manager to query installed .NET packages. For example, on Debian/Ubuntu, use dpkg -l | grep dotnet
or apt list --installed | grep dotnet
.