Skip to content

Delete unnecessary spaces #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 47 additions & 47 deletions docs/msbuild/itemdefinitiongroup-element-msbuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,80 @@
title: "ItemDefinitionGroup Element (MSBuild) | Microsoft Docs"
ms.date: "03/13/2017"
ms.topic: "reference"
f1_keywords:
f1_keywords:
- "http://schemas.microsoft.com/developer/msbuild/2003#ItemDefinitionGroup"
dev_langs:
dev_langs:
- "VB"
- "CSharp"
- "C++"
- "jsharp"
helpviewer_keywords:
helpviewer_keywords:
- "ItemDefinitionGroup Element [MSBuild]"
- "<ItemDefinitionGroup> Element [MSBuild]"
ms.assetid: 4e9fb04b-5148-4ae5-a394-42861dd62371
author: mikejo5000
ms.author: mikejo
manager: jillfra
ms.workload:
ms.workload:
- "multiple"
---
# ItemDefinitionGroup element (MSBuild)
The `ItemDefinitionGroup` element lets you define a set of Item Definitions, which are metadata values that are applied to all items in the project, by default. ItemDefinitionGroup supersedes the need to use the [CreateItem task](../msbuild/createitem-task.md) and the [CreateProperty task](../msbuild/createproperty-task.md). For more information, see [Item definitions](../msbuild/item-definitions.md).
The `ItemDefinitionGroup` element lets you define a set of Item Definitions, which are metadata values that are applied to all items in the project, by default. ItemDefinitionGroup supersedes the need to use the [CreateItem task](../msbuild/createitem-task.md) and the [CreateProperty task](../msbuild/createproperty-task.md). For more information, see [Item definitions](../msbuild/item-definitions.md).

\<Project>
\<ItemDefinitionGroup>
\<Project>
\<ItemDefinitionGroup>

## Syntax
## Syntax

```xml
<ItemDefinitionGroup Condition="'String A' == 'String B'">
<Item1>... </Item1>
<Item2>... </Item2>
</ItemDefinitionGroup>
```
```xml
<ItemDefinitionGroup Condition="'String A' == 'String B'">
<Item1>... </Item1>
<Item2>... </Item2>
</ItemDefinitionGroup>
```

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

### Attributes
### Attributes

|Attribute|Description|
|---------------|-----------------|
|`Condition`|Optional attribute. Condition to be evaluated. For more information, see [Conditions](../msbuild/msbuild-conditions.md).|
|Attribute|Description|
|---------------|-----------------|
|`Condition`|Optional attribute. Condition to be evaluated. For more information, see [Conditions](../msbuild/msbuild-conditions.md).|

### Child elements
### Child elements

|Element|Description|
|-------------|-----------------|
|[Item](../msbuild/item-element-msbuild.md)|Defines the inputs for the build process. There may be zero or more `Item` elements in an `ItemDefinitionGroup`.|
|Element|Description|
|-------------|-----------------|
|[Item](../msbuild/item-element-msbuild.md)|Defines the inputs for the build process. There may be zero or more `Item` elements in an `ItemDefinitionGroup`.|

### Parent elements
### Parent elements

| Element | Description |
| - | - |
| [Project](../msbuild/project-element-msbuild.md) | Required root element of an [!INCLUDE[vstecmsbuild](../extensibility/internals/includes/vstecmsbuild_md.md)] project file. |

## Example
The following code example defines two metadata items, m and n, in an ItemDefinitionGroup. In this example, the default metadata "m" is applied to Item "i" because metadata "m" is not explicitly defined by Item "i". However, default metadata "n" is not applied to Item "i" because metadata "n" is already defined by Item "i".
## Example
The following code example defines two metadata items, m and n, in an ItemDefinitionGroup. In this example, the default metadata "m" is applied to Item "i" because metadata "m" is not explicitly defined by Item "i". However, default metadata "n" is not applied to Item "i" because metadata "n" is already defined by Item "i".

```xml
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<i>
<m>m1</m>
<n>n1</n>
</i>
</ItemDefinitionGroup>
<ItemGroup>
<i Include="a">
<o>o1</o>
<n>n2</n>
</i>
</ItemGroup>
...
</Project>
```
```xml
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<i>
<m>m1</m>
<n>n1</n>
</i>
</ItemDefinitionGroup>
<ItemGroup>
<i Include="a">
<o>o1</o>
<n>n2</n>
</i>
</ItemGroup>
...
</Project>
```

## See also
[Project file schema reference](../msbuild/msbuild-project-file-schema-reference.md)
[Items](../msbuild/msbuild-items.md)
## See also
[Project file schema reference](../msbuild/msbuild-project-file-schema-reference.md)
[Items](../msbuild/msbuild-items.md)