NAnt SDK Documentation - v0.92 |

# AssemblyNameFunctions.GetVersion Method

Gets the version of the assembly.

[Visual Basic]
<Function(Name:="get-version")>
Public Shared Function GetVersion( _
ByVal assemblyName As AssemblyName _
) As Version
[C#]
[Function(Name="get-version")]
public static Version GetVersion(
AssemblyName assemblyName
);

#### Parameters

assemblyName
  The AssemblyName of the assembly.

#### Return Value

The version of the assembly.

#### Example

Output the major version of the `nunit.framework` assembly to the build log.

    <echo message="${version::get-major-version(assemblyname::get-version(assemblyname::get-assembly-name('nunit.framework.dll')))}" />

#### See Also

AssemblyNameFunctions Class | NAnt.Core.Functions Namespace | GetName | VersionFunctions