How to check net framework version
How to check net framework version
.NET Framework consists of two main components, which are versioned separately:
A PowerShell 2.0 module.
The NET Framework Setup subkey in the registry path does not begin with a period.
.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 and Windows 10 October 2020 Update and Windows 10 May 2021 Update: 528372 On Windows 11 and Windows Server 2022: 528449 On all other Windows operating systems (including other Windows 10 operating systems): 528049 |
Minimum version
.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 |
Use Registry Editor
From the Start menu, choose Run, enter regedit, and then select OK.
(You must have administrative credentials to run regedit.)
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.
Query the registry using code
Use the RegistryKey.OpenBaseKey and RegistryKey.OpenSubKey methods to access the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full subkey in the Windows registry.
Add the directive using Microsoft.Win32 or Imports Microsoft.Win32 at the top of your code file if you haven’t already done so.
The example displays output like the following:
This example follows the recommended practice for version checking:
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 |
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.
Query the registry using code (older framework versions)
Use the Microsoft.Win32.RegistryKey class to access the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP subkey in the Windows registry.
The example displays output similar to the following:
Find CLR versions
The Clrver.exe tool
The Environment class
Query the Environment.Version property to retrieve a Version object.
The returned System.Version object identifies the version of the runtime that’s currently executing the code. It doesn’t return assembly versions or other versions of the runtime that may have been installed on the computer.
After you have the Version object, query it as follows:
For the major release identifier (for example, 4 for version 4.0), use the Version.Major property.
For the minor release identifier (for example, 0 for version 4.0), use the Version.Minor property.
For the entire version string (for example, 4.0.30319.18010), use the Version.ToString method. This method returns a single value that reflects the version of the runtime that’s executing the code. It doesn’t return assembly versions or other runtime versions that may be installed on the computer.
The following example uses the Environment.Version property to retrieve CLR version information:
The example displays output similar to the following:
How to check net framework version
.NET Framework consists of two main components, which are versioned separately:
A PowerShell 2.0 module.
[!NOTE] The NET Framework Setup subkey in the registry path does not begin with a period.
.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 and Windows 10 October 2020 Update and Windows 10 May 2021 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 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 |
Use Registry Editor
From the Start menu, choose Run, enter regedit, and then select OK.
(You must have administrative credentials to run regedit.)
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.
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.
[!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.
The example displays output like the following:
This example follows the recommended practice for version checking:
[!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 |
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.
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.
The example displays output similar to the following:
Find CLR versions
The Clrver.exe tool
The Environment class
Query the xref:System.Environment.Version?displayProperty=nameWithType property to retrieve a xref:System.Version object.
The returned System.Version object identifies the version of the runtime that’s currently executing the code. It doesn’t return assembly versions or other versions of the runtime that may have been installed on the computer.
After you have the Version object, query it as follows:
For the major release identifier (for example, 4 for version 4.0), use the xref:System.Version.Major%2A?displayProperty=nameWithType property.
For the minor release identifier (for example, 0 for version 4.0), use the xref:System.Version.Minor%2A?displayProperty=nameWithType property.
For the entire version string (for example, 4.0.30319.18010), use the xref:System.Version.ToString%2A?displayProperty=nameWithType method. This method returns a single value that reflects the version of the runtime that’s executing the code. It doesn’t return assembly versions or other runtime versions that may be installed on the computer.
The following example uses the xref:System.Environment.Version%2A?displayProperty=nameWithType property to retrieve CLR version information:
The example displays output similar to the following:
Модуль PowerShell 2.0.
Подраздел NET Framework Setup в пути реестра не начинается с точки.
Минимальная версия
Использование редактора реестра
В меню Пуск выберите Выполнить, введите regedit и нажмите кнопку ОК.
(Для запуска программы regedit необходимы учетные данные администратора.)
Использование PowerShell для проверки минимальной версии
Отправка запросов в реестр с помощью кода
RegistryKey.OpenBaseKeyиспользуйте методы и RegistryKey.OpenSubKey для доступа к подразделу RegistryKey.OpenBaseKey в реестре Windows.
Добавьте директиву using Microsoft.Win32 или Imports Microsoft.Win32 в начало файла кода, если вы еще этого не сделали.
Этот пример выводит данные, подобные следующим:
В этом примере применяются рекомендации для проверки версии:
Подраздел NET Framework Setup в пути реестра не начинается с точки.
Версия платформы | Подраздел реестра | Значение |
---|---|---|
1.0 | хклм\софтваре\микрософт\. NETFramework\Policy\v1.0\3705 | Установка REG_SZ равно |
1,1 | Setup\NDP\v1.1.4322 Framework HKLM\Software\Microsoft\NET | Установка REG_DWORD равно |
2.0 | Setup\NDP\v2.0.50727 Framework HKLM\Software\Microsoft\NET | Установка REG_DWORD равно |
3.0 | Setup\NDP\v3.0\Setup Framework HKLM\Software\Microsoft\NET | Инсталлсукцесс REG_DWORD равно |
3,5 | Setup\NDP\v3.5 Framework HKLM\Software\Microsoft\NET | Установка REG_DWORD равно |
Клиентский профиль 4.0 | Setup\NDP\v4\Client Framework HKLM\Software\Microsoft\NET | Установка REG_DWORD равно |
Полный профиль 4.0 | Setup\NDP\v4\Full Framework HKLM\Software\Microsoft\NET | Установка REG_DWORD равно |
Использование редактора реестра (более ранние версии платформы)
В меню Пуск выберите Выполнить, введите regedit и нажмите кнопку ОК.
Для запуска программы regedit необходимы учетные данные администратора.
Запрос реестра с помощью кода (более ранние версии платформы)
Microsoft.Win32.RegistryKeyиспользуйте класс для доступа к подразделу Microsoft.Win32.RegistryKey в реестре Windows.
В этом примере отобразятся выходные данные, аналогичные следующим:
Поиск версий CLR
Инструмент Clrver.exe
Класс
Выполните запрос к свойству Environment.Version, чтобы получить объект Version.
Возвращенный объект System.Version указывает версию среды выполнения, в которой в настоящее время выполняется код. Он не содержит версий сборок или других версий среды выполнения, которые установлены на компьютере.
Получив объект Version, выполните к нему запрос:
Для основного идентификатора выпуска (например, 4 для версии 4,0) используйте свойство.
Для дополнительного идентификатора выпуска (например, 0 для версии 4,0) используйте свойство.
Для всей строки версии (например, 4.0.30319.18010) используйте метод. Он возвращает одно значение, соответствующее версии среды выполнения, в которой выполняется код. Он не возвращает версий сборок или других версий среды выполнения, которые установлены на компьютере.
В следующем примере свойство Environment.Version используется для получения сведений о версии среды CLR:
В этом примере отобразятся выходные данные, аналогичные следующим:
Release Number | .NET Framework version |
378389 | .NET Framework 4.5 |
378675 | NET Framework 4.5.1 on Windows 8.1 and Windows Server 2012 R2 |
378758 | .NET Framework 4.5.1 on Windows 8, Windows 7 SP1, Windows Vista SP2 |
379893 | .NET Framework 4.5.2 |
393295 | .NET Framework 4.6 on Windows 10 |
393297 | .NET Framework 4.6 |
394254 | .NET Framework 4.6.1 on Windows 10 1511 |
394271 | .NET Framework 4.6.1 |
394802 | .NET Framework 4.6.2 on Windows 10 1607 |
394806 | .NET Framework 4.6.2 |
460798 | .NET Framework 4.7 on Windows 10 1703 |
460805 | .NET Framework 4.7 |
461308 | .NET Framework 4.7.1 on Windows 10 1709 |
461310 | .NET Framework 4.7.1 |
461808 | .NET Framework 4.7.2 on Windows 10 1803 |
461814 | .NET Framework 4.7.2 |
528372 | .NET Framework 4.8 on Windows 10 2004, 20H2, and 21H1 |
528040 | .NET Framework 4.8 on Windows 10 1903 and 1909 |
528449 | .NET Framework 4.8 on Windows Server 2022 and Windows 11 |
528049 | .NET Framework 4.8 (other Window versions) |
You can get information about installed versions and releases of the NET Framework on your computer using PowerShell. The easiest way to get this information directly from the registry is by using the Get-ChildItem and Get-ItemProperty cmdlets (more about managing registry entries with PowerShell).
.Net versions 2.0, 3.0, 3.5, and 4.7 are installed on this computer.
You can display only the release number for (.Net 4.x versions):
Or you can get a list of domain computers with the Get-ADComputer cmdlet (from the Active Directory for Windows PowerShell module). The following command will select all active Windows Server hosts in the domain:
dir %WINDIR%\Microsoft.Net\Framework\v* /O:-N /B
4. .NET Version Check
There is also a check on the version number of the currently installed Internet Explorer which might be useful for older systems. Some buttons are provided for copying the information to the clipboard and printing or emailing it. Inside the zip file, there is a command line version (.com file) that you can use in batch files. The command line version doesn’t need administrative privileges like the GUI version does.
The information provided in both the GUI and command line tool gives a version number as opposed to an easily readable name. That can make it difficult to determine whether minor or service pack versions are installed.
6. Checking Manually
It’s not the most accurate method but at least gives you a rough idea of what’s installed by just using Windows File Explorer.
Источники информации:
- http://github.com/dotnet/docs/blob/main/docs/framework/migration-guide/how-to-determine-which-versions-are-installed.md
- http://docs.microsoft.com/ru-ru/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
- http://woshub.com/how-to-check-net-framework-version/
- http://www.raymond.cc/blog/how-to-check-what-version-of-microsoft-net-framework-is-installed-in-computer/2/