BuildItem Class
Represents a single item in an MSBuild project.
MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0.
Assembly: Microsoft.Build.Engine (in Microsoft.Build.Engine.dll)
| Name | Description | |
|---|---|---|
![]() | BuildItem(String^, ITaskItem^) | Initializes a new instance of the BuildItem class based on an ITaskItem object. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | BuildItem(String^, String^) | Initializes a new instance of the BuildItem class with the specified Name and Include property values. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
| Name | Description | |
|---|---|---|
![]() | Condition | Gets or sets the Condition attribute value of the item. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | CustomMetadataCount | Gets the number of custom attributes that are set on this item. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | CustomMetadataNames | Gets all user-defined or custom attribute names. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | Exclude | Gets or sets the Exclude attribute value of the item. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | FinalItemSpec | Gets the final specification of the item after all wildcards and properties have been evaluated. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | Include | Gets or sets the Include attribute that created the BuildItem. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | IsImported | Gets a value indicating whether the item was imported into the project. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | MetadataCount | Gets the number of metadata set on the item MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | MetadataNames | Gets the names of metadata on the item, including pre-defined or reserved item-spec modifiers. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | Name | Gets or sets the name of the item collection to which the item belongs. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
| Name | Description | |
|---|---|---|
![]() | Clone() | Creates a shallow copy of the BuildItem. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | CopyCustomMetadataTo(BuildItem^) | Copies all item metadata on this BuildItem to the specified BuildItem. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | Equals(Object^) | (Inherited from Object.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetEvaluatedMetadata(String^) | Returns the value of the specified item metadata after after all item and property references have been evaluated. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetMetadata(String^) | Returns the value of the specified item metadata. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | GetType() | (Inherited from Object.) |
![]() | HasMetadata(String^) | Indicates whether the item has the specified item metadata. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | RemoveMetadata(String^) | Removes the specified item metadata. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | SetMetadata(String^, String^) | Assigns the specified value to the specified item metadata. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | SetMetadata(String^, String^, Boolean) | Assigns the specified value to the specified item metadata, and optionally treats the metadata as a literal value. MSBuild is now included in Visual Studio instead of the .NET Framework. You can use MSBuild 12.0 side-by-side with versions previously deployed with the .NET Framework.For more information, see What's New in MSBuild 12.0. |
![]() | ToString() | (Inherited from Object.) |
An Item element in a project can represent multiple items through the use of wildcards. Therefore, each BuildItem object does not necessarily represent an Item element in the project.
The following example creates a Project object and uses the LoadXml method to add content to the project. The BuildItem, BuildItemGroup, and BuildItemGroupCollection classes are used to add, remove, and change items in the project.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


