Common MSBuild Project Items
In MSBuild, an item is a named reference to one or more files. Items contain metadata such as file names, paths, and version numbers. All project types in Visual Studio have several items in common. These items are defined in the file microsoft.build.commontypes.xsd.
The following is a list of all the common project items.
Represents an assembly (managed) reference in the project.
Item Attribute Name | Description |
|---|---|
HintPath | Optional string. Relative or absolute path of the assembly. |
Name | Optional string. The display name of the assembly, for example, "System.Windows.Forms." |
FusionName | Optional string. Specifies the simple or strong fusion name for the item. When this attribute is present, it can save time because the assembly file does not have to be opened to obtain the fusion name. |
SpecificVersion | Optional boolean. Specifies whether only the version in the fusion name should be referenced. |
Aliases | Optional string. Any aliases for the reference. |
Private | Optional boolean. Specifies whether the reference should be copied to the output folder. This attribute matches the Copy Local property of the reference that's in the Visual Studio IDE. |
Represents a COM (unmanaged) component reference in the project.
Item Attribute Name | Description |
|---|---|
Name | Optional string. The display name of the component. |
Guid | Optional string. A GUID for the component, in the form {12345678-1234-1234-1234-1234567891234}. |
VersionMajor | Optional string. The major part of the version number of the component. For example, "5" if the full version number is "5.46." |
VersionMinor | Optional string. The minor part of the version number of the component. For example, "46" if the full version number is "5.46." |
LCID | Optional string. The LocaleID for the component. |
WrapperTool | Optional string. The name of the wrapper tool that is used on the component, for example, "tlbimp." |
Isolated | Optional boolean. Specifies whether the component is a reg-free component. |
Represents a reference to another project.
Item Attribute Name | Description |
|---|---|
Name | Optional string. The display name of the reference. |
Project | Optional string. A GUID for the reference, in the form {12345678-1234-1234-1234-1234567891234}. |
Package | Optional string. The path of the project file that is being referenced. |
Represents the source files for the compiler.
Item Attribute Name | Description |
|---|---|
DependentUpon | Optional string. Specifies the file this file depends on to compile correctly. |
AutoGen | Optional boolean. Indicates whether the file was generated for the project by the Visual Studio integrated development environment (IDE). |
Link | Optional string. The notational path to be displayed when the file is physically located outside the influence of the project file. |
Visible | Optional boolean. Indicates whether to display the file in Solution Explorer in Visual Studio. |
CopyToOutputDirectory | Optional boolean. Default value = false. Specifies whether to copy the file to the output directory. |
Represents resources to be embedded in the generated assembly.
Item Attribute Name | Description |
|---|---|
DependentUpon | Optional boolean. Indicates whether, to compile correctly, the file depends on another file. |
Generator | Required string. The name of any file generator that is run on this item. |
LastGenOutput | Required string. The name of the file that was created by any file generator that ran on this item. |
CustomToolNamespace | Required string. The namespace in which any file generator that runs on this item should create code. |
Link | Optional string. The notational path is displayed if the file is physically located outside the influence of the project. |
Visible | Optional boolean. Indicates whether to display the file in Solution Explorer in Visual Studio. |
CopyToOutputDirectory | Optional boolean. Default value = false. Specifies whether to copy the file to the output directory. |
LogicalName | Required string. The logical name of the embedded resource. |
Represents files that are not compiled into the project, but may be embedded or published together with it.
Item Attribute Name | Description |
|---|---|
DependentUpon | Optional boolean. Indicates whether, to be embedded or published correctly, the file depends on another file. |
Generator | Required string. The name of any file generator that runs on this item. |
LastGenOutput | Required string. The name of the file that was created by any file generator that was run on this item. |
CustomToolNamespace | Required string. The namespace in which any file generator that runs on this item should create code. |
Link | Optional boolean. Indicates whether to display the file in Solution Explorer in Visual Studio. |
PublishState | Required string. The publish state of the content, either:
|
IsAssembly | Optional boolean. Specifies whether the file is an assembly. |
Visible | Optional boolean. Indicates whether to display the file in Solution Explorer in Visual Studio. |
CopyToOutputDirectory | Optional boolean. Default value = false. Specifies whether to copy the file to the output directory. |
Represents files that should have no role in the build process.
Item Attribute Name | Description |
|---|---|
DependentUpon | Optional boolean. Indicates whether, to be embedded or published correctly, the file depends on another file. |
Generator | Required string. The name of any file generator that is run on this item. |
LastGenOutput | Required string. The name of the file that was created by any file generator that ran on this item. |
CustomToolNamespace | Required string. The namespace in which any file generator that runs on this item should create code. |
Link | Optional string. The notational path to be displayed if the file is physically located outside the influence of the project. |
Visible | Optional boolean. Indicates whether to display the file in Solution Explorer in Visual Studio. |
CopyToOutputDirectory | Optional boolean. Default value = false. Specifies whether to copy the file to the output directory. |