Version Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

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

public ref class Version sealed

The Version type exposes the following members.

  NameDescription
Public methodVersion(Int32, Int32)Initializes a new instance of the Version class using the specified major and minor values.
Public methodVersion(Int32, Int32, Int32, Int32)Initializes a new instance of the Version class with the specified major, minor, build, and revision numbers.
Top

  NameDescription
Public propertyBuildGets the value of the build component of the version number for the current Version object.
Public propertyMajorGets the value of the major component of the version number for the current Version object.
Public propertyMinorGets the value of the minor component of the version number for the current Version object.
Public propertyRevisionGets the value of the revision component of the version number for the current Version object.
Top

  NameDescription
Public methodEqualsReturns a value indicating whether the current Version object is equal to a specified object. (Overrides Object..::..Equals(Object).)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringConverts the value of the current Version object to its equivalent String representation. (Overrides Object..::..ToString()()()().)
Top

Version numbers consist of two to four components: major, minor, build, and revision. The major and minor components are required; the build and revision components are optional, but the build component is required if the revision component is defined. All defined components must be integers greater than or equal to 0. The format of the version number is as follows (optional components are shown in square brackets ([ and ]):

major.minor[.build[.revision]]

The components are used by convention as follows:

  • Major: Assemblies with the same name but different major versions are not interchangeable. A higher version number might indicate a major rewrite of a product where backward compatibility cannot be assumed.

  • Minor: If the name and major version number on two assemblies are the same, but the minor version number is different, this indicates significant enhancement with the intention of backward compatibility. This higher minor version number might indicate a point release of a product or a fully backward-compatible new version of a product.

  • Build: A difference in build number represents a recompilation of the same source. Different build numbers might be used when the processor, platform, or compiler changes.

  • Revision: Assemblies with the same name, major, and minor version numbers but different revisions are intended to be fully interchangeable. A higher revision number might be used in a build that fixes a security hole in a previously released assembly.

Subsequent versions of an assembly that differ only by build or revision numbers are considered to be Hotfix updates of the prior version.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: