NAnt SDK Documentation - v0.92 |

# AssemblyNameFunctions.GetAssemblyName Method

Gets the AssemblyName for a given file.

[Visual Basic]
<Function(Name:="get-assembly-name")>
Public Function GetAssemblyName( _
ByVal assemblyFile As String _
) As AssemblyName
[C#]
[Function(Name="get-assembly-name")]
public AssemblyName GetAssemblyName(
string assemblyFile
);

#### Parameters

assemblyFile
  The assembly file for which to get the AssemblyName.

#### Return Value

An AssemblyName object representing the given file.

#### Remarks

The assembly is not added to this domain.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentException | assemblyFile is an empty String.
FileNotFoundException | assemblyFile does not exist.
BadImageFormatException | assemblyFile is not a valid assembly.

#### Example

Output the full name of the `nunit.framework` assembly to the build log.

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

#### See Also

AssemblyNameFunctions Class | NAnt.Core.Functions Namespace