NAnt SDK Documentation - v0.92

GacCache.IsAssemblyInGac Method 

Determines whether an assembly is installed in the Global Assembly Cache given its file name or path.

[Visual Basic]
Public Function IsAssemblyInGac( _
   ByVal assemblyFile As String _
) As Boolean
[C#]
public bool IsAssemblyInGac(
   string assemblyFile
);

Parameters

assemblyFile
The name or path of the file that contains the manifest of the assembly.

Return Value

true if assemblyFile is installed in the Global Assembly Cache; otherwise, false.

Remarks

To determine whether the specified assembly is installed in the Global Assembly Cache, the assembly is loaded into a separate AppDomain.

If the family of the current runtime framework does not match the family of the current target framework, this method will return false for all assemblies as there's no way to determine whether a given assembly is in the Global Assembly Cache for another framework family than the family of the current runtime framework.

See Also

GacCache Class | NAnt.Core.Util Namespace