Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
MSBuild Reference
 Output Element (MSBuild)

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

Other versions are also available for the following:
.NET Framework General Reference
Output Element (MSBuild)

Stores task output values in items and properties.

<Output TaskParameter="Parameter"
    PropertyName="PropertyName" 
    Condition = "'String A' == 'String B'" />

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

Attributes

Attribute

Description

TaskParameter

Required attribute.

The name of the task's output parameter.

PropertyName

Either the PropertyName or ItemName attribute is required.

The property that receives the task's output parameter value. Your project can then reference the property with the $(PropertyName) syntax. This property name can either be a new property name or a name that is already defined in the project.

This attribute cannot be used if ItemName is also being used.

ItemName

Either the PropertyName or ItemName attribute is required.

The item that receives the task's output parameter value. Your project can then reference the item with the @(ItemName) syntax. The item name can either be a new item name or a name that is already defined in the project.

This attribute cannot be used if PropertyName is also being used.

Condition

Optional attribute.

Condition to be evaluated. For more information, see MSBuild Conditions.

Child Elements

None.

Parent Elements

Element

Description

Task

Creates and executes an instance of an MSBuild task.

The following code example shows the Csc task being executed inside of a Target element. The items and properties passed to the task parameters are declared outside of the scope of this example. The value from the output parameter OutputAssembly is stored in the FinalAssemblyName item, and the value from the output parameter BuildSucceeded is stored in the BuildWorked property. For more information, see MSBuild Tasks.

<Target Name="Compile" DependsOnTargets="Resources">
    <Csc  Sources="@(CSFile)"
            TargetType="library"
            Resources="@(CompiledResources)"
            EmitDebugInformation="$(includeDebugInformation)"
            References="@(Reference)"
            DebugType="$(debuggingType)"
            OutputAssembly="$(builtdir)\$(MSBuildProjectName).dll" >
        <Output TaskParameter="OutputAssembly"
                  ItemName="FinalAssemblyName" />
        <Output TaskParameter="BuildSucceeded"
                  PropertyName="BuildWorked" />
    </Csc>
</Target>
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