Invokes the specified targets within the project file.
The following table describes the parameters of the
Contains the outputs of all built targets.
Specifies the target or targets to build.
Note When an MSBuild task is run, its output is cached in a scope (ProjectFileName, GlobalProperties)[TargetNames] as a list of build items.
If a target specified in
Targets fails and
true, the task continues to build the remaining targets.
If you want to build the default targets, use the MSBuild task and set the
Projects parameter equal to
CallTarget, MSBuild evaluates the called target in a new scope, as opposed to the same scope it's called from. This means that any item and property changes in the called target are not visible to the calling target. To pass information to the calling target, use the
TargetOutputs output parameter.
In addition to the parameters listed above, this task inherits parameters from the TaskExtension class, which itself inherits from the Task class. For a list of these additional parameters and their descriptions, see TaskExtension base class.
The following example calls
TargetA from inside
<Project DefaultTargets="CallOtherTargets" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="CallOtherTargets"> <CallTarget Targets="TargetA"/> </Target> <Target Name="TargetA"> <Message Text="Building TargetA..." /> </Target> </Project>