This documentation is archived and is not being maintained.
RemoveDuplicates Task
Visual Studio 2010
Removes duplicate items from the specified item collection.
This task is case insensitive and does not compare item metadata when determining duplicates.
In addition to the parameters listed above, this task inherits parameters from the TaskExtension class, which itself inherits from the Task class. For a list of these additional parameters and their descriptions, see TaskExtension Base Class.
The following example uses the RemoveDuplicates task to remove duplicate items from the MyItems item collection. When the task is complete, the FilteredItems item collection contains one item.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<MyItems Include="MyFile.cs"/>
<MyItems Include="MyFile.cs">
<Culture>fr</Culture>
</MyItems>
<MyItems Include="myfile.cs"/>
</ItemGroup>
<Target Name="RemoveDuplicateItems">
<RemoveDuplicates
Inputs="@(MyItems)">
<Output
TaskParameter="Filtered"
ItemName="FilteredItems"/>
</RemoveDuplicates>
</Target>
</Project>
Show: