How To Verify .Net Framework Version

The .Net Framework is Microsoft promise of “compile once and run everywhere” programming approach. Conceptually, the .Net Framework is similar to Java “write once run everywhere (WORE)” language on JVM, where the interoperability programming feature being one of the vital functionality.

Since Microsoft introduces .Net Framework 1.0 as an optional upgrade on Nov 2000, the latest stable release of .Net Framework 4.0 has been the mandatory component of all Windows Vista and Windows Server 2008 (Longhorn) Operating systems!

How to identify, check, detect or verify the Microsoft .Net Framework version installed on a computer?

There are at least two ways to verify Microsoft .Net Framework version, by Internet Explorer User Agent String or by compiling a .Net program to read the Environment.Version property of System namespace.

Reading the Environment.Version property of System namespace.

If you’re keen on .Net programming, compile either one of these .Net program source code samples that retrieve Environment.Version property to identify .Net Framework version:

C# source code to identify .Net Framework version:

Save this C# source code as DotNetVer.cs and compile it with C# command line compiler, i.e. csc DotNetVer.cs

using System;

class Version
public static void Main()
Console.WriteLine(“.Net Framework Version {0}”,

You can download this compiled program dotnetver.

Put it on c: and launch command dos line


How to compile with c# via a batch file.

Create this batch file named csharp.bat on c:

cd C:WINDOWSMicrosoft.NETFrameworkv2.0.50727
csc /out:c:csharp%1.exe c:csharp%1.cs
echo “Done …”

this script will take source code file from c:csharp like that :

c:csharp dotnetver (without .cs)

You can find from msdn C# compilations instructions

You can find from msdn VB.NET compilations instructions

Enjoy it …


Since 30 years I work on Database Architecture and data migration protocols. I am also a consultant in Web content management solutions and medias protecting solutions. I am experienced web-developer with over 10 years developing PHP/MySQL, C#, VB.Net applications ranging from simple web sites to extensive web-based business applications. Besides my work, I like to work freelance only on some wordpress projects because it is relaxing and delightful CMS for me. When not working, I like to dance salsa and swing and to have fun with my little family.

You may also like...

Leave a Reply