Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

FindUnderPath Task

Determines which items in the specified item collection have paths that are in or below the specified folder.

The following table describes the parameters of the FindUnderPath task.




Optional ITaskItem[] parameter.

Specifies the files whose paths should be compared with the path specified by the Path parameter.


Optional ITaskItem[] output parameter.

Contains the items that were found under the specified path.


Optional ITaskItem[] output parameter.

Contains the items that were not found under the specified path.


Required ITaskItem parameter.

Specifies the folder path to use as the reference.


Optional Boolean parameter.

If true, the paths of the output items are updated to be absolute paths.

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 FindUnderPath task to determine if the files contained in the MyFiles item have paths that exist under the path specified by the SearchPath property. After the task completes, the FilesNotFoundInPath item contains the File1.txt file, and the FilesFoundInPath item contains the File2.txt file.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <MyFiles Include="C:\File1.txt" />
        <MyFiles Include="C:\Projects\MyProject\File2.txt" />


    <Target Name="FindFiles">
                ItemName="FilesFoundInPath" />
                ItemName="FilesNotFoundInPath" />

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.