How To Check .Net Framework Version Installed ???

How To Check .Net Framework Version Installed ???

1. Query the UserAgent string of Internet Explorer web browser. This is the easier way, I think, as every Windows bundled with IE!
Although you need to remember this simple, one line JavaScript:

Copy and paste that line of JavaScript code to IE Address bar and press ENTER key, you will see a pop-up dialog box with .NET version installed.

2. Navigate to this Windows Registry path


The major version number of each .Net framework releases installed can be found at this Registry path. Click the major version number key and there is a string value called “version” on the right-pane that reports the full version number of that .Net framework.

3.Navigate to the Registry path that keeps the IE User Agent String:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform

4.C:\WINNT\Microsoft.NET\Framework /C:\Windows\Microsoft.NET\Framework
directory will have the directories for the version you have installed on your machine.

To be generic , C:\%windir%\Microsoft.NET\Framework will have the directories for the version you have installed on your machine.

5. Query GetCORSystemDirectory Function() API of MsCorEE.dll regarding the the install directory for the version of the runtime that is loaded in the current process.

Sample Code:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

// Declaration
internal static extern void GetCORSystemDirectory([MarshalAs(UnmanagedType.LPTStr)]

System.Text.StringBuilder Buffer,
int BufferLength, ref int Length);

// Gets the path to the Framework directory.
System.Text.StringBuilder sb = new System.Text.StringBuilder(1024);
int size;
// returned value in size can be ignored
GetCORSystemDirectory(sb, sb.Capacity, ref size);