Judging the. NET Framework installation version

Source: Internet
Author: User

How to determine the. NET Framework installed Versions
This topic are a how to .
Please keep it as clear and simple as possible. Avoid speculative discussions as well as a deep dive into underlying mechanisms or related technologies.

Table of Contents
    • Introduction
    • The Microsoft.NET\Framework Folder
    • Registry Keys
    • Determining the. NET Framework Version by Code
    • The Clrver Tool
    • Other Languages
      • Italian (it-it)


Introduction

You can install and run multiple versions of the. NET Framework on a computer and each version can is installed in any Ord Er.
Starting from Windows XP, the operating system comes with a. NET Framework version installed and the. The user can install a more recent version to get all the advantages this comes with the newest class libraries and NAMESP Aces provided by the most recent versions of the. NET Framework.

↑back to Top

The Microsoft.NET\Framework Folder

Each. NET Framework version can installedSide-by-sideAnd each version ' s files would be installedinto a subfolder of the Windows main directory, identified by the environment variable%WINDIR%. To see which versions is installed, look into the%WINDIR% directory for theMicrosoft.NET\Frameworkfolder (you should also view theFramework64Directory if you ' re running a 64-bit operating system, which can has a or 64-bit versions installed or both): each versi The. NET Framework has a directory and the first digits of the directory name identify the. NET Framework Versio N For example:v1.1.4322 for the. NET Framework 1.1, v2.0.50727 for the. NET Framework 2.0, v3.5 for the. NET Framework 3.5 And so on.
Figure 1Depicts the folders containing the files for multiple. NET Framework version installed on a computer running Windows 7 Ult Imate x64 Service Pack 1.

Figure 1: . NET Framework Version specific subfolders.

↑back to Top

Registry Keys

The informations related to the. NET Framework installation (along with the informations regarding the status of the Insta lled Service Packs) is stored in the Windows registry under theHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Se TUP\NDP key. Figure 2 depicts the registry keys for multiple. NET Framework version installed on a computer running Windows 7 Ultimate x64 Service Pack 1.

Figure 2: . NET Framework version specific registry keys.

Table 1 provides a list of the stored values according to each installed. NET Framework version.

level
. NET Framework Version Service PackRegistry Key Name Value
4-client Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v4\client Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v4\client Name: Version, Type: REG_SZ, Data: 4.0.30319.0
4-full Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\ndp\v4\full Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\ndp\v4\full Name: Version, Type: REG_SZ, Data: 4.0.30319.0
3.5 Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 Name: SP, Type:REG_DWORD, Data: 0
3.5 Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 Name: SP, Type:REG_DWORD, Data: 1
3.0 Original Release Follow the deployment and detection guidance in the document ' Microsoft. NET Framework 3.0 Deployment Guide ' on the MSDN Library
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Name: SP, Type:REG_DWORD, Data: 0
3.0 Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Name: SP, Type:REG_DWORD, Data: 1
3.0 Service Pack 2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Name: SP, Type:REG_DWORD, Data: 2
2.0 Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: SP, Type:REG_DWORD, Data: 0
2.0 Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: SP, Type:REG_DWORD, Data: 1
2.0 Service Pack 2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Name: SP, Type:REG_DWORD, Data: 2
1.1 (on 32-bit operating systems) Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: SP, Type:REG_DWORD, Data: 0
1.1 (on 32-bit operating systems) Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: Install, Type:REG_DWORD, Data: 1
1.1 (on 64-bit operating systems) Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: SP, Type:REG_DWORD, Data: 0
1.1 (on 64-bit operating systems) Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: Install, Type:REG_DWORD, Data: 1
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Name: SP, Type:REG_DWORD, Data: 1
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Original Release HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Name: Version, Type: REG_SZ, Data: 1.0.3705.0
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Name: Version, Type: REG_SZ, Data: 1.0.3705.1
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Name: Version, Type: REG_SZ, Data: 1.0.3705.2
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 3 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Name: Version, Type: REG_SZ, Data: 1.0.3705.3
1.0 (Shipped with Windows XP Media Center 2002/2004 and Tablet PC 2004) Service Pack 2 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{fdc11a6f-17d1-48f9-9ea3-9051954baa24} Name: Version, Type: REG_SZ, Data: 1.0.3705.2
1.0 (Shipped with Windows XP Media Center 2005 and Tablet PC 2005) Service Pack 3 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{fdc11a6f-17d1-48f9-9ea3-9051954baa24} Name: Version, Type: REG_SZ, Data: 1.0.3705.3

Table 1: . NET Framework version specific registry keys values.

To detect the existence of a specific. NET Framework version regardless of the service Pack level, or to detect a service Pack level or a later service pack level of the same. NET Framework version with the registry information that listed Table 2.

level
. NET Framework Version Service PackRegistry Key Name Value
4-client Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v4\client Install = 1
4-full Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\ndp\v4\full Install = 1
3.5 Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 Install = 1
3.5 Service Pack 1 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.5 SP >= 1
3.0 Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 Install = 1
3.0 Service Pack 1 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 SP >= 1
3.0 Service Pack 2 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v3.0 SP >= 2
2.0 Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 Install = 1
2.0 Service Pack 1 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 SP >= 1
2.0 Service Pack 2 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v2.0.50727 SP >= 2
1.1 Any Version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 Install = 1
1.1 Service Pack 1 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework setup\ndp\v1.1.4322 SP >= 1
1.0 Any Version Hkey_local_machine\software\microsoft\.net framework\policy\v1.0 Name: 3705, Type: REG_SZ, exists
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 1 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Version >= 1.0.3705.1
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 2 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Version >= 1.0.3705.2
1.0 (on supported platforms except for Windows XP Media Center and Tablet PC) Service Pack 3 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{78705f0d-e8db-4b2d-8193-982bdda15ecd} Version >= 1.0.3705.3
1.0 (Shipped with Windows XP Media Center 2002/2004 and Tablet PC 2004) Service Pack 2 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{fdc11a6f-17d1-48f9-9ea3-9051954baa24} Version >= 1.0.3705.2
1.0 (Shipped with Windows XP Media Center 2005 and Tablet PC 2005) Service Pack 3 or Greater HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{fdc11a6f-17d1-48f9-9ea3-9051954baa24} Version >= 1.0.3705.2

Table 2: . NET Framework version specific registry keys values regardless of the Service Pack level.

↑back to Top

Determining the. NET Framework Version by Code

The. NET Framework version can be determined by writing code, queries the Common Language Runtime (CLR) version by usi ng the Version of the System.Environment class, as in the following C # code snippet

Using System;class sample{public    static void Main ()    {      Console.WriteLine ();      Console.WriteLine ("Version: {0}", Environment.Version.ToString ());}    }

If you compile the. NET Framework 3.5, the "value would be" 2.0.50727.3603.

↑back to Top

The Clrver Tool

The CLR Version tool (Clrver.exe) reports all the installed versions of the Common Language Runtime (CLR) on the computer. This tool is a automatically installed with visual Studio and with the Windows SDK and it must being executed from the visual Studio command Prompt or the Windows SDK command Prompt.
At the command prompt type the following

clrver [option]

where [option] can be -all to display all the managed processes and the version of the CLR they is usin G, -? to display command syntax and options for the tool or PID to display the version (s) of the CLR use D by the process, which has the specified process ID. Running the tool with no options displays all installed CLR versions.

Judge 4.5:https://msdn.microsoft.com/en-us/library/hh925568 (v=vs.110). aspx

Excerpt from: http://social.technet.microsoft.com/wiki/contents/articles/15601. How-to-determine-the-net-framework-installed-versions.aspx

Judging the. NET Framework installation version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.