Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude globs that look like **\subdir\** do not exclude files without extensions #6502

Closed
ladipro opened this issue May 31, 2021 · 3 comments

Comments

@ladipro
Copy link
Member

ladipro commented May 31, 2021

Issue Description

A regression introduced in #6151.
Reported by @ForNeVeR in dotnet/sdk#17976.

Steps to Reproduce

Use an exclude glob that looks like **\subdir\** and have a file without extension under a subdir subdirectory.

Example:

<Project>
  <ItemGroup>
    <Test Include="dir\**" Exclude="**\subdir\**" />
  </ItemGroup>

  <Target Name="Build">
    <Message Text="@(Test, ', ')" />
  </Target>
</Project>

With a file structure as follows:

│   expand.proj
│
└───dir
    └───subdir
            file1.ext
            file2

Expected Behavior

Does not print anything. All included Test items are immediately excluded.

Actual Behavior

Prints dir\subdir\file2.

Analysis

This is another issue with taking *.* too literally. In this case the default filespec is added when parsing **\subdir\** which is understood as **\subdir\**\*.* and files are matched against the actual . dot.

Versions & Configurations

Introduced in 16.10.

@ForNeVeR
Copy link

ForNeVeR commented Jun 1, 2021

For future visitors, see dotnet/sdk#17976 (comment) for a possible workaround.

@benvillalobos benvillalobos removed the needs-triage Have yet to determine what bucket this goes in. label Jun 1, 2021
@ladipro ladipro linked a pull request Jun 7, 2021 that will close this issue
@ahmedalejo
Copy link

ahmedalejo commented Jul 23, 2021

@ladipro this issue seems to be back again.
With the following folder structure

│  API.csproj
│
└──wwwroot
    └──.well-known
           apple-app-site-association

All except the .well-known isn´t include when published.
It also shows as hidden in vs explorer as well.
It looks like it is now not being added by default.
image

I will try adding back
<Content Include="wwwroot\.well-known\**" />
I removed this initially due to this bug (i.e. #17976)

MSBUILD

on Azure DevOps agent.

  • Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET publish includes wwwroot/.well-known folder
  • Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET publish does not includes wwwroot/.well-known folder

@ladipro
Copy link
Member Author

ladipro commented Aug 2, 2021

@ahmedalejo thank you for reporting this. The new behavior is actually by design and what you're seeing with 16.10.1+2fd48ab73 was a bug. Apologies for the inconvenience. I've left a comment in #6708.

@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants