NAnt SDK Documentation - v0.92

NAntFunctions.ScanProbingPaths Method (String)

Searches the probing paths of the current target framework for the specified file.

[Visual Basic]
<EditorBrowsable(State:=EditorBrowsableState.Never), _  Function(Name:="scan-probing-paths")>
Overloads Public Function ScanProbingPaths( _
   ByVal fileName As String _
) As String
[C#]
[EditorBrowsable(State=EditorBrowsableState.Never)]
[Function(Name="scan-probing-paths")]
public string ScanProbingPaths(
   string fileName
);

Parameters

fileName
The name of the file to search for.

Return Value

The absolute path to fileName if found in one of the configured probing; otherwise, an error is reported.

Remarks

The (relative) probing paths are resolved relative to the base directory of the appdomain in which NAnt is running.

The configured probing paths are scanned recursively in the order in which they are defined in the framework configuration.

The file name to search should include the extension.

Exceptions

Exception TypeCondition
FileNotFoundExceptionfileName could not be found in the configured probing paths.

Example

Compile an assembly referencing the nunit.framework assembly for the current target framework that is shipped as part of the NAnt distribution.

    
<csc target="library" output="NAnt.Core.Tests.dll">
    <sources basedir="NAnt.Core">
        <include name="**/*.cs" />
    </sources>
    <references>
        <include name="NAnt.Core.dll" />
        <include name="${framework::get-lib-path('nunit.framework.dll')}" />
    </references>
</csc>
    
  

See Also

NAntFunctions Class | NAnt.Core.Functions Namespace | NAntFunctions.ScanProbingPaths Overload List