NAnt SDK Documentation - v0.85-nightly-2005-11-09

AssemblyNameFunctions.GetAssemblyName Method 

[This is preliminary documentation and subject to change.]

Gets the AssemblyName for a given file.

[Visual Basic]
<Function(Name:="get-assembly-name")>
Public Shared Function GetAssemblyName( _
   ByVal assemblyFile As String _
) As AssemblyName
[C#]
[Function(Name="get-assembly-name")]
public static 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