Skip to content

Excludes or removes in project folder don't apply to recursive includes from a parent folder #1576

@dsplaisted

Description

@dsplaisted

Repro project: ProjectFolder.zip

Consider the following project (named Project.proj):

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <File Include="..\**" Exclude="Project.proj" />
  </ItemGroup>
  <Target Name="Build">
    <Message Text="@(File)"/>
  </Target>
</Project>

The File include is recursively including all files starting in the parent directory of the project. The Exclude statement is expected to prevent the Project.proj file to be excluded.

However, when you build the project:

EXPECTED: The File item (and hence output message) does not include Project.proj
ACTUAL: Project.proj is included in the file item, as ..\ProjectFolder\Project.proj

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions