Table of Contents

Class Version

Namespace
System
Assembly
mscorlib.dll

Represents the version number of an assembly, operating system, or the common language runtime. This class cannot be inherited.

public sealed class Version
Inheritance
Version
Inherited Members
Extension Methods

Constructors

Version(int, int)

Initializes a new instance of the Version class using the specified major and minor values.

public Version(int major, int minor)

Parameters

major int

The major version number.

minor int

The minor version number.

Exceptions

ArgumentOutOfRangeException

Version(int, int, int, int)

Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers.

public Version(int major, int minor, int build, int revision)

Parameters

major int

The major version number.

minor int

The minor version number.

build int

The build number.

revision int

The revision number.

Exceptions

ArgumentOutOfRangeException

Properties

Build

Gets the value of the build component of the version number for the current Version object.

public int Build { get; }

Property Value

int

The build version number.

Major

Gets the value of the major component of the version number for the current Version object.

public int Major { get; }

Property Value

int

The major version number.

Minor

Gets the value of the minor component of the version number for the current Version object.

public int Minor { get; }

Property Value

int

The minor version number.

Revision

Gets the value of the revision component of the version number for the current Version object.

public int Revision { get; }

Property Value

int

The revision version number.

Methods

Equals(object)

Returns a value indicating whether the current Version object is equal to a specified object.

public override bool Equals(object obj)

Parameters

obj object

An object to compare with the current Version object, or null.

Returns

bool

true if the current Version object and obj are both Version objects, and every component of the current Version object matches the corresponding component of obj; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer hash code.

ToString()

Converts the value of the current Version object to its equivalent String representation.

public override string ToString()

Returns

string

The String representation of the values of the major, minor, build, and revision components of the current Version object, as depicted in the following format. Each component is separated by a period character ('.'). Square brackets ('[' and ']') indicate a component that will not appear in the return value if the component is not defined: major.minor[.build[.revision]]