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