Skip to content

Latest commit

 

History

History
75 lines (58 loc) · 2.16 KB

taskbody-element-msbuild.md

File metadata and controls

75 lines (58 loc) · 2.16 KB
title description ms.date ms.topic dev_langs helpviewer_keywords author ms.author manager ms.subservice
Task Element of UsingTask (MSBuild)
Learn about the Task element of the MSBuild UsingTask, which contains the data that is passed to a UsingTask TaskFactory.
03/13/2017
reference
VB
CSharp
C++
Task element [MSBuild]
<Task> element [MSBuild]
ghogen
ghogen
mijacobs
msbuild

Task element of UsingTask (MSBuild)

Contains the data that is passed to a UsingTask TaskFactory. For more information, see UsingTask element (MSBuild).

<Project> <UsingTask> <Task>

Syntax

<Task Evaluate="true/false" />

Attributes and elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
Evaluate Optional Boolean attribute.

If true, MSBuild evaluates any inner elements, and expands items and properties before it passes the information to the TaskFactory when the task is instantiated.

Child elements

Element Description
Data The text between the Task tags is sent verbatim to the TaskFactory.

Parent elements

Element Description
UsingTask Provides a way to register tasks in MSBuild. There may be zero or more UsingTask elements in a project.

Example

The following example shows how to use the Task element with an Evaluate attribute.

<UsingTask TaskName="MyTask" AssemblyName="My.Assembly" TaskFactory="MyTaskFactory">
       <ParameterGroup>
              <Parameter1 ParameterType="System.String" Required="False" Output="False"/>
              <Parameter2 ParameterType="System.Int" Required="True" Output="False"/>
              ...
</ParameterGroup>
       <Task Evaluate="true">
       ... Task factory-specific data ...
       </Task>
</UsingTask>

See also