BlackWaspTM

This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

System Information
.NET 1.1+

Getting the CLR Version

The .NET common language runtime (CLR) is the run-time environment that executes managed code developed in .NET languages such as C# and Visual Basic. The version of the CLR varies for different versions of the .NET framework.

Common Language Runtime

The common language runtime (CLR) is a core part of the .NET framework. It is responsible for executing managed code created using languages such as C# or Visual Basic, which has then been compiled to intermediate language (IL). The CLR provides many services, including memory management and garbage collection.

Sometimes you will want to know which version of the CLR is executing your .NET program. You can obtain the version number by reading the static Version property of the Environment class. This property returns a Version object. It can be converted to a string for output purposes or the four sections of the version number can be read individually using the Major, Minor, Build and Revision properties.

Console.WriteLine(Environment.Version);

It is important to understand that the CLR version number is not the version number of the .NET framework. For example, the .NET framework versions 3.0 and 3.5 both used the CLR version 2.0.

5 April 2011