Как узнать версию net framework в windows 7

от admin

Как узнать установленные версии .NET Framework в Windows?

14.12.2021
useritpro
directoryWindows 10, Windows 11, Windows Server 2016, Windows Server 2019
commentsкомментария 2

В Windows одновременно можно одновременно установить и запустить несколько версий .NET Framework. При разработке или развертывания нового приложения, основанного на библиотеках .NET, иногда нужно предварительно узнать какие версии и пакеты обновления .Net Framework уже установлены на компьютере пользователя или на сервере. Вы можете получить список версий .NET Framework, установленных на компьютере, несколькими способами.

Информация об установленных версиях .NET Framework в реестре

При установке или обновлении любой версии .NET Framework, изменения записываются в реестр Windows.

Откройте редактор реестра (regedit.exe) и перейдите в раздел HKLM\ SOFTWARE\Microsoft\NET Framework Setup\NDP. В этой ветке хранится информация обо всех версиях .NET на компьютере. Разверните любой раздел и обратите внимание на следующие параметры (для .Net 4.x нужно развернуть ветку Full):

  • Install — флаг установки (если равен 1, значит данная версия .Net установлена на компьютере);
  • Install Path — каталог, в который установлена данная версия .Net;
  • Release — номер релиза .Net;
  • Version — полный номер версии .Net Framework.

версии .Net Framework в реестре

К примеру, в данном примере видно, что на компьютере установлены .NET Framework v2.0.50727, 3.0, 3.5 и 4.7 (релиз 460805).

С помощью следующей таблицы вы можете установить соответствие между номером релиза и версией .NET Framework (применимо к .NET 4.5 и выше).

Как узнать версию .NET Framework с помощью PowerShell?

Можно получить информацию об установленных версиях и релизах NET Framework на компьютере с помощью PowerShell. Проще всего получить эти данные напрямую из реестра с помощью командлетов Get-ChildItem и Get-ItemProperty (подробнее о работе с записями реестра из PowerShell).

Чтобы вывести таблицу по всем версиям .Net Framework на компьютере, выполните команду:

Get-ChildItem ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP’ -Recurse | Get-ItemProperty -Name version -EA 0 | Where < $_.PSChildName -Match ‘^(?!S)\p’> | Select PSChildName, version

вывести список установленных версий .net framework с помощью powershell

На этом компьютере установлены версии .Net 2.0, 3.0, 3.5 и 4.7.

Можно вывести только номер релиза (для версий .Net 4.x):

(Get-ItemProperty ‘HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full’ -Name Release).Release

получить номер релиза net framework из консоли powershell

Согласно таблице, номер 528449 соответствует версии .Net Framework 4.8 в Windows 11.

Проверить версию .Net Framework на удаленных компьютерах

Вы можете удаленно получить список версий .Net Framework, установленных на компьютерах в вашей сети помощью PowerShell.

Ниже представлен небольшой PowerShell скрипт, который получает список компьютеров из текстового файла и проверяет на всех версию .Net Framework. Для запуска команд на удаленных компьютерах используется WinRM командлет Invoke-Command.

Скрипт выводит табличку (через Out-GridView) со списком версий .Net Framework, установленных на удаленных компьютерах.

poweshell скрипт для получения версий net framework на удаленных компьютерах

Также вы можете задать список компьютеров, на которых нужно проверить .NET так:

Или выбрать список компьютеров из домена с помощью командлета Get-ADComputer из модуля AD PowerShell. Следующая команда выберет все активные хосты Windows Server в домене:

$servers= Get-ADComputer -Filter ‘operatingsystem -like «*Windows server*» -and enabled -eq «true»‘

Вывести версии .NET Framework в командной строке

Все версии.NET Framework устанавливаются в следующие каталоги Windows:

  • %SystemRoot%\Microsoft.NET\Framework
  • %SystemRoot%\Microsoft.NET\Framework64

Вы можете просто открыть этот каталог и увидеть список установленных версий .NET. Каждой версии соответствует отдельный каталог с символом v и номером версии в качестве имени папки. Можно вывести список установленных версий .NET Framework из команды строки:

dir %WINDIR%\Microsoft.Net\Framework\v* /O:-N /B

узнать версию net framework из командной строки windows

Команда выведет все установленные версии кроме 4.5, т.к. .NET Framework 4.5 устанавливается в подкаталог v4.0.xxxxx.

Предыдущая статьяПредыдущая статья Следующая статья Следующая статья

Name already in use

docs / docs / framework / migration-guide / how-to-determine-which-versions-are-installed.md

  • Go to file T
  • Go to line L
  • Copy path
  • Copy permalink
  • Open with Desktop
  • View raw
  • Copy raw contents Copy raw contents

Copy raw contents

Copy raw contents

How to: Determine which .NET Framework versions are installed

Users can install and run multiple versions of .NET Framework on their computers. When you develop or deploy your app, you might need to know which .NET Framework versions are installed on the user’s computer. The registry contains a list of the versions of .NET Framework installed on the computer.

[!NOTE] This article is specific to .NET Framework. To determine which .NET Core and .NET 5+ SDKs and runtimes are installed, see How to check that .NET is already installed.

.NET Framework consists of two main components, which are versioned separately:

A set of assemblies, which are collections of types and resources that provide the functionality for your apps. .NET Framework and the assemblies share the same version number. For example, .NET Framework versions include 4.5, 4.6.1, and 4.7.2.

The common language runtime (CLR), which manages and executes your app’s code. A single CLR version typically supports multiple .NET Framework versions. For example, CLR version 4.0.30319.xxxxx where xxxxx is less than 42000, supports .NET Framework versions 4 through 4.5.2. CLR version greater than or equal to 4.0.30319.42000 supports .NET Framework versions starting with .NET Framework 4.6.

Community-maintained tools are available to help detect which .NET Framework versions are installed:

A .NET Framework 2.0 command-line tool.

A PowerShell 2.0 module.

For information about detecting the installed updates for each version of .NET Framework, see How to: Determine which .NET Framework updates are installed.

Determine which .NET implementation and version an app is running on

You can use the xref:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription?displayProperty=nameWithType property to query for which .NET implementation and version your app is running on. If the app is running on .NET Framework, the output will be similar to:

By comparison, if the app is running on .NET Core or .NET 5+, the output will be similar to:

Detect .NET Framework 4.5 and later versions

The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET Framework 4.5 or above isn’t installed.

[!NOTE] The NET Framework Setup subkey in the registry path does not begin with a period.

The Release REG_DWORD value in the registry represents the version of .NET Framework installed.

.NET Framework version Value of Release
.NET Framework 4.5 All Windows operating systems: 378389
.NET Framework 4.5.1 On Windows 8.1 and Windows Server 2012 R2: 378675
On all other Windows operating systems: 378758
.NET Framework 4.5.2 All Windows operating systems: 379893
.NET Framework 4.6 On Windows 10: 393295
On all other Windows operating systems: 393297
.NET Framework 4.6.1 On Windows 10 November Update systems: 394254
On all other Windows operating systems (including Windows 10): 394271
.NET Framework 4.6.2 On Windows 10 Anniversary Update and Windows Server 2016: 394802
On all other Windows operating systems (including other Windows 10 operating systems): 394806
.NET Framework 4.7 On Windows 10 Creators Update: 460798
On all other Windows operating systems (including other Windows 10 operating systems): 460805
.NET Framework 4.7.1 On Windows 10 Fall Creators Update and Windows Server, version 1709: 461308
On all other Windows operating systems (including other Windows 10 operating systems): 461310
.NET Framework 4.7.2 On Windows 10 April 2018 Update and Windows Server, version 1803: 461808
On all Windows operating systems other than Windows 10 April 2018 Update and Windows Server, version 1803: 461814
.NET Framework 4.8 On Windows 10 May 2019 Update and Windows 10 November 2019 Update: 528040
On Windows 10 May 2020 Update, October 2020 Update, May 2021 Update, November 2021 Update, and 2022 Update: 528372
On Windows 11 and Windows Server 2022: 528449
On all other Windows operating systems (including other Windows 10 operating systems): 528049
.NET Framework 4.8.1 On Windows 11 2022 Update: 533320
All other Windows operating systems: 533325

To determine whether a minimum version of .NET Framework is present, check for a Release REG_DWORD value that’s greater than or equal to the corresponding value listed in the following table. For example, if your application runs under .NET Framework 4.8 or a later version, test for a Release REG_DWORD value that’s greater than or equal to 528040.

.NET Framework version Minimum value
.NET Framework 4.5 378389
.NET Framework 4.5.1 378675
.NET Framework 4.5.2 379893
.NET Framework 4.6 393295
.NET Framework 4.6.1 394254
.NET Framework 4.6.2 394802
.NET Framework 4.7 460798
.NET Framework 4.7.1 461308
.NET Framework 4.7.2 461808
.NET Framework 4.8 528040
.NET Framework 4.8.1 533320

Use Registry Editor

From the Start menu, choose Run, enter regedit, and then select OK.

(You must have administrative credentials to run regedit.)

In the Registry Editor, open the following subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey isn’t present, then you don’t have .NET Framework 4.5 or later installed.

Check for a REG_DWORD entry named Release. If it exists, then you have .NET Framework 4.5 or later installed. Its value corresponds to a particular version of .NET Framework. In the following figure, for example, the value of the Release entry is 528040, which is the release key for .NET Framework 4.8.

Registry entry for .NET Framework 4.5

Use PowerShell to check for a minimum version

Use PowerShell commands to check the value of the Release entry of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full subkey.

The following examples check the value of the Release entry to determine whether .NET Framework 4.6.2 or later is installed. This code returns True if it’s installed and False otherwise.

Query the registry using code

Use the xref:Microsoft.Win32.RegistryKey.OpenBaseKey%2A?displayProperty=nameWithType and xref:Microsoft.Win32.RegistryKey.OpenSubKey%2A?displayProperty=nameWithType methods to access the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full subkey in the Windows registry.

[!IMPORTANT] If the app you’re running is 32-bit and running in 64-bit Windows, the registry paths will be different than previously listed. The 64-bit registry is available in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ subkey. For example, the registry subkey for .NET Framework 4.5 is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full.

Check the Release REG_DWORD value to determine the installed version. To be forward-compatible, check for a value greater than or equal to the value listed in the .NET Framework version table.

The following example checks the value of the Release entry in the registry to find the versions of .NET Framework 4.5-4.8.1 that are installed.

[!TIP] Add the directive using Microsoft.Win32 or Imports Microsoft.Win32 at the top of your code file if you haven’t already done so.

. code language=»csharp» source=»snippets/csharp/versions-installed.cs» .

. code language=»vb» source=»snippets/visual-basic/versions-installed.vb» .

The example displays output like the following:

Query the registry using code PowerShell

The following example uses PowerShell to check the value of the Release entry in the registry to find the versions of .NET Framework 4.5-4.8.1 that are installed:

This example follows the recommended practice for version checking:

  • It checks whether the value of the Release entry is greater than or equal to the value of the known release keys.
  • It checks in order from most recent version to earliest version.

Detect .NET Framework 1.0 through 4.0

Each version of .NET Framework from 1.1 to 4.0 is listed as a subkey at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP. The following table lists the path to each .NET Framework version. For most versions, there’s an Install REG_DWORD value of 1 to indicate this version is installed. In these subkeys, there’s also a Version REG_SZ value that contains a version string.

[!NOTE] The NET Framework Setup subkey in the registry path does not begin with a period.

Framework Version Registry Subkey Value
1.0 HKLM\Software\Microsoft\.NETFramework\Policy\v1.0\3705 Install REG_SZ equals 1
1.1 HKLM\Software\Microsoft\NET Framework Setup\NDP\v1.1.4322 Install REG_DWORD equals 1
2.0 HKLM\Software\Microsoft\NET Framework Setup\NDP\v2.0.50727 Install REG_DWORD equals 1
3.0 HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.0\Setup InstallSuccess REG_DWORD equals 1
3.5 HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5 Install REG_DWORD equals 1
4.0 Client Profile HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Client Install REG_DWORD equals 1
4.0 Full Profile HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full Install REG_DWORD equals 1

[!IMPORTANT] If the app you’re running is 32-bit and running in 64-bit Windows, the registry paths will be different than previously listed. The 64-bit registry is available in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ subkey. For example, the registry subkey for .NET Framework 3.5 is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v3.5.

Notice that the registry path to the .NET Framework 1.0 subkey is different from the others.

Use Registry Editor (older framework versions)

From the Start menu, choose Run, enter regedit, and then select OK.

You must have administrative credentials to run regedit.

Open the subkey that matches the version you want to check. Use the table in the Detect .NET Framework 1.0 through 4.0 section.

The following figure shows the subkey and its Version value for .NET Framework 3.5.

The registry entry for .NET Framework 3.5.

Query the registry using code (older framework versions)

Use the xref:Microsoft.Win32.RegistryKey?displayProperty=nameWithType class to access the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP subkey in the Windows registry.

[!IMPORTANT] If the app you’re running is 32-bit and running in 64-bit Windows, the registry paths will be different than previously listed. The 64-bit registry is available in the HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ subkey. For example, the registry subkey for .NET Framework 3.5 is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v3.5.

The following example finds the versions of .NET Framework 1-4 that are installed:

. code language=»csharp» source=»snippets/csharp/versions-installed.cs» .

. code language=»vb» source=»snippets/visual-basic/versions-installed.vb» .

The example displays output similar to the following:

Query the registry using PowerShell (older framework versions)

The following example uses PowerShell to check the value of the Release entry in the registry to find the versions of .NET Framework 1-4 that are installed:

Find CLR versions

The .NET Framework CLR installed with .NET Framework is versioned separately. There are two ways to detect the version of the .NET Framework CLR:

How do I find the .NET version?

How do I find out which version of .NET is installed?

I’m looking for something as simple as java -version that I can type at the command prompt and that tells me the current version(s) installed.

I better add that Visual Studio may not be installed — this is typically something that I want to know about a client machine.

Himanshu's user avatar

23 Answers 23

There is an easier way to get the exact version .NET version installed on your machine from a cmd prompt. Just follow the following instructions;

Open the command prompt (i.e Windows + R → type "cmd").

Type the following command, all on one line:

(This will list all the .NET versions.)

If you want to check the latest .NET 4 version.

Type following instruction, on a single line:

Please find the attached image below to see how it is shown.

Enter image description here

shA.t's user avatar

AnandShanbhag's user avatar

Just type any one of the below commands to give you the latest version in the first line.

You can only run these from the Visual Studio Command prompt if you have Visual Studio installed, or else if you have the .NET framework SDK, then the SDK Command prompt.

The last command (5) will list out all the versions (except 4.5) of .NET installed, latest first.
You need to run the 4th command to see if .NET 4.5 is installed.

Another three options from the PowerShell command prompt is given below.

The last command (8) will give you all versions, including .NET 4.5.

Peter Mortensen's user avatar

This answer is applicable to .NET Core only!

Typing dotnet —version in your terminal of choice will print out the version of the .NET Core SDK in use.

Learn more about the dotnet command here.

Tobias Tengler's user avatar

FelixAVeras's user avatar

Before going to a command prompt, please follow these steps.

Go to "C:/Windows/Microsoft.NET/Framework" → Inside this folder, there will be folder(s) like (all or any):

  • v1.0.3705
  • v2.0.50727
  • v3.5
  • v4.0.30319

Your latest .NET version would be in the highest v number folder, so if "v4.0.30319" is available that would hold your latest .NET framework. However, the "v4.0.30319" does not mean that you have the .NET framework version 4.0. The "v4.0.30319" is your Visual C# compiler version, therefore, in order to find the .NET framework version do the following.

Go to a command prompt and follow this path:

C:\Windows\Microsoft.NET\Framework\v4.0.30319 (or whatever the highest v number folder)

Microsoft (R) Visual C# Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 Copyright (C) Microsoft Corporation. All rights reserved.

Example below:

Enter image description here

Himanshu's user avatar

Sunimal Kaluarachchi's user avatar

.NET Version Detector is a GUI utility that displays which of the six(!) versions of the framework are installed.

Peter Mortensen's user avatar

For the version of the framework that is installed, it varies depending on which service packs and hotfixes you have installed. Take a look at this MSDN page for more details. It suggests looking in %systemroot%\Microsoft.NET\Framework to get the version.

Environment.Version will programmatically give you the version of the CLR.

Note that this is the version of the CLR, and not necessarily the same as the latest version of the framework you have installed (.NET 3.0 and 3.5 both use v2 of the CLR).

Peter Mortensen's user avatar

MSDN details it here very nicely on how to check it from registry:

  1. On the Start menu, choose Run.
  2. In the Open box, enter regedit.exe.You must have administrative credentials to run regedit.exe.
  3. In the Registry Editor, open the following subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

  1. On the Start menu, choose Run.
  2. In the Open box, enter regedit.exe. You must have administrative credentials to run regedit.exe.
  3. In the Registry Editor, open the following subkey:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

Note: The last row in the above snapshot which got clipped reads On all other OS versions: 461310 . I tried my level best to avoid the information getting clipped while taking the screenshot but the table was way too big.

Какие версии .Net Framework установлены в системе

Узнать, какия версии .Net Framework установлены в вашей Windows можно двумя способами. Первый самый простой, для этого потребуется программа ASoft .NET Version Detector. А для второго не нужны никакие дополнительные средства, кроме редактора реестра Windows.

1. ASoft .NET Version Detector

Потребуется просто запустить программу.

ASoft .NET Version Detector

Установленные версии выделены белым цветом шрифта, не установленные серым. В списке внизу окна выводится более подробная информация о месте расположения папок с .Net Framework и установленных версиях.

2. Системный реестр

Запускаем Редактор реестра: Пуск -> Выполнить -> regedit.

Переходим в раздел HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

Редактор реестра с открытой веткой установленных версий .Net Framework

Видим ветки с номерами версий и дополнительными параметрами.

Install = 1 говорит что версия установлена.
SP показывает номер установленного Service Pack.
Version показывает полный номер версии.

Читать:
Как выйти из shell

Похожие статьи