.NET versions
finding .NET versions
check installed .NET
.NET framework
.NET installation guide

How do I find the installed .NET versions?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

The .NET framework is a pivotal element for building and running applications on Windows, and knowing which versions are installed on your system can be crucial for development and troubleshooting. Microsoft regularly updates .NET, so having a grasp of the installed versions can help ensure compatibility and leverage new features.

In this article, you will learn several methods to determine which versions of the .NET Framework and .NET Core are installed on your Windows system, using both command-line tools and graphical interfaces. We'll explore the nuances and technical specifics surrounding this task.

Checking Installed .NET Versions

There are multiple methods to determine the installed versions of .NET. These methods vary slightly based on whether you are dealing with .NET Framework or .NET Core/.NET 5+.

1. Using Command-Line Tools

.NET Framework

The .NET Framework information is stored in the Windows Registry. You can access this by using the regedit command or through PowerShell.

  • PowerShell Method:
    Open PowerShell and run the following command:
powershell
1  Get-ChildItem "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP" | 
2  Get-ItemProperty -name Version, Release -EA 0 | 
3  Where { $_.PSChildName -match '^(?!S)\p{L}'} | 
4  Select PSChildName, Version, Release

The Release key, specifically, is used to identify newer versions (starting with .NET Framework 4.5). Here is a table mapping Release values to .NET Framework versions:

Release Key.NET Framework Version
3783894.5
3786754.5.1
3798934.5.2
3932954.6
3942544.6.1
3948024.6.2
4607984.7
4613084.7.1
4618084.7.2
5280404.8

.NET Core / .NET 5+

  • Command Prompt or PowerShell:
    To check .NET Core or .NET 5+ versions, use the following command in Command Prompt or PowerShell:
bash
  dotnet --list-sdks

This command will list all installed SDKs on the system. You can also list installed runtimes using:

bash
  dotnet --list-runtimes

Example output:

 
  3.1.408 [C:\Program Files\dotnet\sdk]
  5.0.203 [C:\Program Files\dotnet\sdk]

2. Using the Registry Editor

For those who prefer a graphical interface, you can use the Windows Registry Editor to find the installed .NET Framework versions.

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP.
  3. Expand the version folders and check the Version string for exact details.

3. Programmatically Determining .NET Versions

If you are developing an application and want to programmatically check installed .NET versions, both the .NET Framework and .NET Core provide classes to interact with.

.NET Framework

You can obtain the framework version in your code with System.Environment.Version. However, this only provides the CLR version, which might not completely represent the .NET Framework version post 4.5.

.NET Core / .NET 5+

For .NET Core, you can use:

csharp
1using System;
2
3class Program
4{
5    static void Main()
6    {
7        Console.WriteLine(System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription);
8    }
9}

This will output something like ".NET Core 3.1.13" or ".NET 5.0.3".

Conclusion

Being able to identify your installed .NET versions is a fundamental skill for developers, ensuring you can troubleshoot issues and build applications that align with the correct dependencies. Whether you're using command-line tools, registry checks, or programmatic methods, knowing how to navigate these options will prepare you for efficient and informed development on the .NET ecosystem.

By leveraging the approaches shared in this article, you'll be well-equipped to assess and manage the .NET infrastructure on your systems, ensuring compatibility and maximizing functionality.


Course illustration
Course illustration

All Rights Reserved.