MSBuild well-known item metadata
The following table describes the metadata assigned to every item upon creation. In each example, the following item declaration was used to include the file C:\MyProject\Source\Program.cs in the project.
<ItemGroup> <MyItem Include="Source\Program.cs" /> </ItemGroup>
|%(FullPath)||Contains the full path of the item. For example:
|%(RootDir)||Contains the root directory of the item. For example:
|%(Filename)||Contains the file name of the item, without the extension. For example:
|%(Extension)||Contains the file name extension of the item. For example:
|%(RelativeDir)||Contains the path specified in the
|%(Directory)||Contains the directory of the item, without the root directory. For example:
If the folder C:\MySolution\MyProject\Source\ contains the file Program.cs, and if the project file contains this item:
then the value of
|%(Identity)||The item specified in the
|%(ModifiedTime)||Contains the timestamp from the last time the item was modified. For example:
|%(CreatedTime)||Contains the timestamp from when the item was created. For example:
|%(AccessedTime)||Contains the timestamp from the last time the item was accessed.