We recommend using Visual Studio 2017

Item Metadata in Target Batching


For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see Item Metadata in Target Batching on docs.microsoft.com. MSBuild has the ability to perform dependency analysis on the inputs and outputs of a build target. If it is determined that the inputs or outputs of the target are up-to-date, the target will be skipped and the build will procede. Target elements use the Inputs and Outputs attributes to specify the items to inspect during dependency analysis.

If a target contains a task that uses batched items as inputs or outputs, the Target element of the target should use batching in its Inputs or Outputs attributes to enable MSBuild to skip batches of items that are already up-to-date.

The following example contains an item list named Res that is divided into two batches based on the Culture item metadata. Each of these batches is passed into the AL task, which creates an output assembly for each batch. By using batching on the Outputs attribute of the Target element, MSBuild can determine if each of the individual batches is up-to-date before running the target. Without using target batching, both batches of items would be run by the task every time the target was executed.

        <Res Include="Strings.fr.resources">  
        <Res Include="Strings.jp.resources">  
        <Res Include="Menus.fr.resources">  
        <Res Include="Dialogs.fr.resources">  
        <Res Include="Dialogs.jp.resources">  
        <Res Include="Menus.jp.resources">  
    <Target Name="Build"  
        <AL Resources="@(Res)"  

How to: Build Incrementally
Target Element (MSBuild)
Item Metadata in Task Batching