Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
General Reference
MSBuild Reference
 ItemGroup Element (MSBuild)

  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 
ItemGroup Element (MSBuild) 

Contains a set of user-defined Item elements. Every item used in a MSBuild project must be specified as a child of an ItemGroup element.

<ItemGroup Condition="'String A' == 'String B'">
    <Item1>... </Item1>
    <Item2>... </Item2>
</ItemGroup>

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

Attributes

Attribute Description

Condition

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

Child Elements

Element Description

Item

Defines the inputs for the build process. There may be zero or more Item elements in an ItemGroup.

Parent Elements

Element Description

Project

Required root element of an MSBuild project file.

The following code example shows the user-defined item collections Res and CodeFiles declared inside of an ItemGroup element. Each of the items in the Res item collection contains a user-defined child ItemMetadata element.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemGroup>
        <Res Include = "Strings.fr.resources" >
            <Culture>fr</Culture>
        </Res>
        <Res Include = "Dialogs.fr.resources" >
            <Culture>fr</Culture>
        </Res>

        <CodeFiles Include="**\*.cs" Exclude="**\generated\*.cs" />
        <CodeFiles Include="..\..\Resources\Constants.cs" />
    </ItemGroup>
...
</Project>
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