
Creating Items in a Project File
Items are declared in the project file by creating an element as a child of an ItemGroup element with the name of the item. The Include attribute of the element specifies what files to include with that item collection. For example, the following code creates an item collection named Compile, which includes two files.
|
<ItemGroup>
<Compile Include = "file1.cs"/>
<Compile Include = "file2.cs"/>
</ItemGroup>
|
The following code creates the same item collection by declaring both files in one Include attribute, separated by a semicolon.
|
<ItemGroup>
<Compile Include = "file1.cs;file2.cs"/>
</ItemGroup>
|