Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
General Reference
MSBuild Reference
Task Reference
 CallTarget Task

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework General Reference 
CallTarget Task 

Invokes the specified targets within the project file.

The following table describes the parameters of the CallTarget task.

Parameter Description

RunEachTargetSeparately

Optional Boolean output parameter.

If true, the MSBuild engine is called once per target. If false, the MSBuild engine is called once to build all targets.

TargetOutputs

Optional ITaskItem[] output parameter.

Contains the outputs of all built targets.

Targets

Optional String[] parameter.

Specifies the target or targets to build.

If a target specified in Targets fails and RunEachTargetSeparately is 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 $(MSBuildProjectFile).

The following example calls TargetA from inside CallOtherTargets.

<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>

Concepts

MSBuild Targets

Other Resources

MSBuild Task Reference

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker