Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 2.41 KB

File metadata and controls

79 lines (61 loc) · 2.41 KB
title Parameter Element
description Learn about the MSBuild Parameter element, which contains information about a specific parameter for a task generated by a UsingTask TaskFactory.
ms.date 03/13/2017
ms.topic reference
dev_langs
VB
CSharp
C++
xml
helpviewer_keywords
Parameter element [MSBuild]
<Parameter> element [MSBuild]
author ghogen
ms.author ghogen
ms.subservice msbuild

Parameter element

Contains information about a specific parameter for a task that is generated by a UsingTask TaskFactory. The name of the element is the name of the parameter. For more information, see UsingTask element (MSBuild).

<Project> <UsingTask> <ParameterGroup> <Parameter>

Syntax

<ParameterGroup ParameterType="SystemType"
    Output="true/false"
    Required="true/false" />

Attributes and elements

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

Attributes

Attribute Description
ParameterType Optional attribute.

The .NET type of the parameter, for example, System.String.
Output Optional Boolean attribute.

If true, this parameter is an output parameter for the task. By default, the value is false.
Required Optional Boolean attribute.

If true, this parameter is a required parameter for the task. By default, the value is false.

Child elements

None.

Parent elements

Element Description
ParameterGroup Contains an optional list of parameters that will be present on the task that is generated by a UsingTask TaskFactory.

Example

The following example shows how to use the Parameter element.

<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