NAnt SDK Documentation - v0.92 |

# FrameworkFunctions.GetToolPath Method

Gets the absolute path of the specified tool for the current target framework.

[Visual Basic]
<Function(Name:="get-tool-path")>
Public Function GetToolPath( _
ByVal tool As String _
) As String
[C#]
[Function(Name="get-tool-path")]
public string GetToolPath(
string tool
);

#### Parameters

tool
  The file name of the tool to search for.

#### Return Value

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

#### Remarks

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

The file name of the tool to search should include the extension.

#### Exceptions

Exception Type | Condition
--- | ---
FileNotFoundException | tool could not be found in the configured tool paths.

#### Example

Use gacutil to install an assembly in the GAC.

    <exec program="${framework::get-tool-path('gacutil.exe')}" managed="strict">
        <arg value="/i" />
        <arg file="Cegeka.HealthFramework.dll" />
    </exec>

#### See Also

FrameworkFunctions Class | NAnt.Core.Functions Namespace