Sunday, September 19, 2010

Find Out CLR Version

The versions of the .Net framework differ in parts substantially in their functionalities, the current version 4 provides much more features than version 1.
Core component of the .Net framework is the so called Common Language Runtime (CLR), which is the runtime environment, in which the programs run.
To determine this version nummer, the class System.Environment.Version is needed.
The following line of code reads out the installed version of the CLR, in which the program runs:

string CLRVersion = System.Environment.Version.ToString();

Note though, that the version of the Common Language Runtime is not identical to the version of the .Net framework!
The .Net versions 1.0 and 1.1 use the CLR version 1.0, the .Net framework 2.0, 3.0 and 3.5 the version 2.0 and the current .Net framework 4.0 uses CLR 4.0.

No comments:

Post a Comment