NAnt SDK Documentation - v0.92 |

# TargetFunctions.GetCurrentTarget Method

Gets the name of the target being executed.

[Visual Basic]
<Function(Name:="get-current-target")>
Public Function GetCurrentTarget() As String
[C#]
[Function(Name="get-current-target")]
public string GetCurrentTarget();

#### Return Value

A String that contains the name of the target being executed.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | No target is being executed.

#### See Also

TargetFunctions Class | NAnt.Core.Functions Namespace