Environment.Version Property

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public static Version Version { get; }

Property Value

Type: System.Version
An object that displays the version of the common language runtime.

For the .NET Framework Versions 4, 4.5, 4.5.1, and 4.5.2, the Version property returns a Version object whose string representation has the form 4.0.30319.xxxxx. For, it has the form 4.0.30319.42000 .

Caution noteCaution

For the .NET Framework 4.5 later, we do not recommend using the Version property to detect the version of the runtime; instead, you can determine the version of the common language runtime by querying the registry. For more information, see How to: Determine Which .NET Framework Versions Are Installed.

For more information about the version of the common language runtime that is installed with each version of the .NET Framework, see .NET Framework Versions and Dependencies.

The following example displays the version of the common language runtime. (The version is omitted from the example output for security reasons.)

// Sample for the Environment.Version property 
using System;

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft