Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Version Property

AssemblyName.Version Property

Gets or sets the major, minor, build, and revision numbers of the assembly.

Namespace:  System.Reflection
Assemblies:   mscorlib (in mscorlib.dll)
  System.Reflection (in System.Reflection.dll)

member Version : Version with get, set

Property Value

Type: System.Version
An object that represents the major, minor, build, and revision numbers of the assembly.

All components of the version must be integers greater than or equal to zero. Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of UInt16.MaxValue - 1. If a component exceeds this value, no error is thrown; however, in a dynamic assembly, that component is zero.

This section contains two examples. The first example shows how to retrieve the version of the currently executing assembly. The second example shows how to use the Version property to specify the assembly version when you emit a dynamic assembly.

Example 1

The following example retrieves and displays the version numbers of the currently executing assembly and the assembly that contains the String class.

No code example is currently available or this language may not be supported.

Example 2

The following example emits a dynamic assembly and saves it to the current directory. When the assembly is created, the Version property is used to specify version information for the assembly.

No code example is currently available or this language may not be supported.

.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

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft