Export (0) Print
Expand All

RemoveDuplicates Task

Removes duplicate items from the specified item collection.

The following table describes the parameters of the RemoveDuplicates task.

Parameter

Description

Filtered

Optional ITaskItem[] output parameter.

Contains an item collection with all duplicate items removed.

Inputs

Optional ITaskItem[] parameter.

The item collection to remove duplicate items from.

This task is case insensitive and does not compare item metadata when determining duplicates.

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>

Community Additions

ADD
Show:
© 2014 Microsoft