BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object System.ICloneable System.IComparable System.IComparable<System.Version> System.IEquatable<System.Version>

Represents the version number of an assembly.

numbers for an assembly consist of two to four components: , , , and . Components and must be defined. and components are optional. Component can be used if and only if build is defined. All defined components must be a greater than or equal to zero.

By convention, the components are used as follows:

Major: Assemblies with the same name but different major versions are not interchangeable. This would be appropriate, for example, for a major rewrite of a product where backwards compatibility cannot be assumed.

Minor: If the name and major number on two assemblies are the same, but the minor number is different, this indicates significant enhancement with the intention of backwards compatibility. This would be appropriate, for example, on a "point release" of a product or a fully backward compatible new version of a product.

Assemblies with the same name, major, and minor version numbers but different revisions are intended to be fully interchangeable. This would be appropriate, for example, to fix a security hole in a previously released assembly.

A difference in build number is intended to represent a recompilation of the same source. This would be appropriate, for example, because of processor, platform, or compiler changes.
- Constructor

  Constructs and initializes a new instance of the class.

  and are set to zero. and are unspecified.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor

  A that represents 2 to 4 integers separated by period characters ('.'). Each component delineated by a period character will be parsed to a with (). The numbers will be processed in the following order: , , , . If the or the and the components are not represented by , their values will be undefined.

  The formatting of must be as follows, with optional components shown in square brackets ('[' and']'): .[.[.]], where each component returns a with ().

  Constructs and initializes a new instance of the class using the values represented by the specified .

  To be added.
  has fewer than 2 components or more than 4 components (i.e. fewer than 1 or more than 3 period characters).
  is a null reference.
  , , , or is less than zero.
  At least one component of does not parse to a with ().

  The following example sets the version to "6.1.2.4" and writes the result to the console.

  using System;

  public class Vers { public static void Main() {

  Version vers = new Version( "6.1.2.4" ); Console.WriteLine( "Version is {0}", vers.ToString() ); } }

  The output is

  Version is 6.1.2.4

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A specifying the major component.
  A specifying the minor component.
  To be added.
  To be added.

  Constructs and initializes a new instance of the class using the specified major and minor values.

  To be added.
  or is less than zero.

  The following example sets the version to "6.1" and writes the result to the console.

  using System;

  public class Vers { public static void Main() {

  Version vers = new Version( 6, 1 ); Console.WriteLine( "Version is {0}", vers.ToString() ); } }

  The output is

  Version is 6.1

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A specifying the major component.
  A specifying the minor component.
  A specifying the build component.
  To be added.
  To be added.
  To be added.

  Constructs and initializes a new instance of the class using the specified major, minor, and build values.

  To be added.
  , , or is less than zero.

  The following example sets the version to "6.1.2" and writes the result to the console.

  using System;

  public class Vers { public static void Main() {

  Version vers = new Version( 6, 1, 2 ); Console.WriteLine( "Version is {0}", vers.ToString() ); } }

  The output is

  Version is 6.1.2

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Constructor
  A specifying the major component.
  A specifying the minor component.
  A specifying the build component.
  A specifying the revision component.
  To be added.
  To be added.
  To be added.
  To be added.

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

  To be added.
  , , , or is less than zero.

  The following example sets the version to "6.1.2.4" and writes the result to the console.

  using System;

  public class Vers { public static void Main() {

  Version vers = new Version( 6, 1, 2, 4 ); Console.WriteLine( "Version is {0}", vers.ToString() ); } }

  The output is

  Version is 6.1.2.4

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Int32

  Gets the value of the build component of the current instance.

  A specifying the build component, or -1 if the build component is undefined.

  This property is read-only.

  If the version number is 6.1.2.4, the build component is 2. If the version number is 6.1, the build component is -1, which is considered to be undefined.

  `using System; class VersionBuildExample { public static void Main() { Version vers = new Version("6.1.2.4"); Console.Write("The build component of "); Console.WriteLine("version vers = {0}.", vers.Build); } }`

  The output is

  The build component of version vers = 2.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Object

  Returns a new with values equal to the property values of the current instance.

  A new whose values are equal to the property values of the current instance.

  The returned by this method must be explicitly cast to a before it can be used as one.

  This method is implemented to support the interface.

  The following example clones the version number and writes the result to the console.

  `using System; class VersionCloneExample { public static void Main() { Version vers = new Version("6.1.2.4"); Console.WriteLine("The string representation of the" + " version is {0}.", vers.ToString()); Version clone = (Version) vers.Clone(); Console.WriteLine("The original version was" + " successfully cloned."); Console.Write("The string representation of the" + " cloned version is {0}.", clone.ToString()); } }`

  The output is

  The string representation of the version is 6.1.2.4.

  The original version was successfully cloned.

  The string representation of the cloned version is 6.1.2.4.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Int32 `` The to compare to the current instance.

  Returns the sort order of the current instance compared to the specified .

  The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to . For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

  Return Value
  Description
  A negative number
  Current instance < .
  Zero
  Current instance == .
  A positive number

  Current instance > , or is a null reference.

  The components of in decreasing order of importance are: , , , and . An undefined component is assumed to be older than any defined component.

  This method is implemented to support the interface.

  is not a and is not a null reference `using System; class VersionTest { static string Test ( Version v1, Version v2 ) { int i = v1.CompareTo(v2); if ( i < 0 ) return "older than"; else if ( i == 0 ) return "the same as"; else return "newer than"; } public static void Main() { Version vers1 = new Version( "6.1.2.4" ); Version vers2 = new Version( 6, 1 ); Version vers3 = new Version( 6, 1, 3 ); Console.Write("Version {0} is {1} ", vers1, Test(vers1, vers2)); Console.WriteLine("version {0}", vers2); Console.Write("Version {0} is {1} ", vers1, Test(vers1, vers3)); Console.WriteLine("version {0}", vers3); Console.Write("Version {0} is {1} ", vers3, Test(vers3, vers3)); Console.WriteLine("version {0}", vers3); Console.Write("Version {0} is {1} ", vers2, Test(vers2, vers1)); Console.WriteLine("version {0}", vers1); } }`

  The output is

  Version 6.1.2.4 is newer than version 6.1

  Version 6.1.2.4 is older than version 6.1.3

  Version 6.1.3 is the same as version 6.1.3

  Version 6.1 is older than version 6.1.2.4

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Int32 `` To be added.

  Returns the sort order of the current instance compared to the specified .

  The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to . For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

  Return Value
  Description
  A negative number
  Current instance < .
  Zero
  Current instance == .
  A positive number

  Current instance > , or is a null reference.

  The components of in decreasing order of importance are: , , , and . An undefined component is assumed to be older than any defined component.

  This method is implemented to support the interface.

  2.0.0.0
  4.0.0.0
- Method
  System.Boolean `` The to compare to the current instance. To be added.

  Determines whether the current instance and the specified represent the same type and value.

  A where indicates is the same type as the current instance and has equal , , , and properties as the current instance. If is a null reference or is not an instance of , returns .

  This method overrides .

  `using System; class VersionEqualsExample { static void testEquals(Version v1, Version v2) { Console.Write("It is {0} that version ", v1.Equals(v2)); Console.WriteLine("{0} is equal to {1}.", v1, v2); } public static void Main() { Version vers1 = new Version( "6.1.2.4" ); Version vers2 = new Version( 6, 1 ); testEquals( vers1, vers1 ); testEquals( vers1, vers2 ); } }`

  The output is

  It is True that version 6.1.2.4 is equal to 6.1.2.4.

  It is False that version 6.1.2.4 is equal to 6.1.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Boolean `` To be added.

  Determines whether the current instance and the specified represent the same value.

  A where indicates has equal , , , and properties as the current instance. If is a null reference, returns .

  This method is implemented to support the interface.

  2.0.0.0
  4.0.0.0
- Method
  System.Int32

  Generates a hash code for the current instance.

  A containing the hash code for the current instance.

  The algorithm used to generate the hash code is unspecified.

  This method overrides .

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Int32

  Gets the value of the major component of the current instance.

  A specifying the major component.

  This property is read-only.

  If the version number is 6.1, the major version is 6.

  `using System; class VersionMajorExample { public static void Main() { Version vers = new Version("6.1.2.4"); Console.Write("The major component "); Console.WriteLine("of version vers = {0}.", vers.Major); } }`

  The output is

  The major component of version vers = 6.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Int16 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.Int32

  Gets the value of the minor component of the current instance.

  A specifying the minor component.

  This property is read-only.

  If the version number is 6.1, the minor component is 1.

  `using System; class VersionMinorExample { public static void Main() { Version vers = new Version("6.1.2.4"); Console.Write("The minor component "); Console.WriteLine("of version vers = {0}.", vers.Minor); } }`

  The output is

  The minor component of version vers = 1.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Int16 To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether two instances of are equal.

  A where indicates and have equal , , , and properties, or both and are ; otherwise .

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether the first instance of is greater than the second instance of .

  A where indicates is greater than ; otherwise . If is , is returned.

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  is a reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether the first instance of is greater than or equal to the second instance of .

  A where indicates is greater than or equal to ; otherwise . If is , is returned.

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  is a reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether two instances of are not equal.

  A where indicates and have at least one unequal property; otherwise . If and are both , returns false; if one is but not the other, returns .

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether the first instance of is less than the second instance of .

  A where indicates is less than ; otherwise . If is , is returned.

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  is a reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Boolean `` `` An instance of the class. An instance of the class.

  Determines whether the first instance of is less than or equal to the second instance of .

  A where indicates is less than or equal to ; otherwise . If is , is returned.

  The parts of the version number are compared independently starting with the property and then the , , and properties, in order. This method returns as soon as one of the properties is determined not to be equal.

  is a reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  4.0.0.0
  System.Version `` To be added. To be added. To be added. To be added.
- Property
  System.Int32

  Gets the value of the revision component of the current instance.

  A specifying the revision component, or -1 if the revision component is undefined.

  This property is read-only.

  If the version number is 6.1.2.4, the revision component is 4. If the version number is 6.1, the revision component is considered to be undefined.

  `using System; class VersionRevisionExample { public static void Main() { Version vers = new Version("6.1.2.4"); Console.Write("The revision component of "); Console.WriteLine("version vers = {0}.", vers.Revision); } }`

  The output is

  The revision component of version vers = 4.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.String To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  4.0.0.0
  System.Boolean `` `` To be added. To be added. To be added. To be added. To be added.
0 System.Runtime.InteropServices.ComVisible(true)