-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 is overzealous when exclude pattern is an absolute path prefix of include directory #2813
Comments
cc @livarcocc - this is solved in 3.x but not 2.2.x latest stable, thoughts? |
Man, github is a small world, I actually went to school with @rla4, whether she remembers or not. I am not sure exactly which change happened in 3.0 to fix this issue there. @peterhuene can you take a look? Depending on the change, we can try to do bar check and bring it the fix to 2.2 in a servicing release. |
iirc, there was a fix from the community related to output option handling that I think went into master. I'll try to dig it up. |
dotnet/cli#9892 was the PR I'm thinking of. That might have addressed this issue. I'll check. |
That wasn't what addressed the issue in 3.0, so now I'm bisecting. |
I'm actually able to reproduce this in 3.0, both in
I can also reproduce it without modifying the output path and without default items enabled:
Edit <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
<ItemGroup>
<Compile Include="**/*.cs" Exclude="c:\users\peter\foo/**/*" />
</ItemGroup>
</Project> Note: replace the full path in the exclude to be the same base bath where If the
Pinging @rainersigwald in case he has additional information that might be useful. |
@rainersigwald given the repro above in my comment that makes it appear the problem lies in how globs are handled in MSBuild, so I move the issue there? |
Great find! Moved to dotnet/msbuild#4175, with an even smaller repro. I understand the fix, too. |
…0190911.2 (#2813) - Microsoft.NETCore.App - 5.0.0-alpha1.19461.2 Dependency coherency updates - Microsoft.NET.Sdk.WindowsDesktop - 5.0.0-alpha1.19460.11 (parent: Microsoft.NETCore.App) - System.CodeDom - 5.0.0-alpha1.19460.21 (parent: Microsoft.NETCore.App) - System.Security.Cryptography.ProtectedData - 5.0.0-alpha1.19460.21 (parent: Microsoft.NETCore.App) - System.Text.Encoding.CodePages - 5.0.0-alpha1.19460.21 (parent: Microsoft.NETCore.App)
When building an SDK project, the source files are not being collected correctly, causing a "CS5001: Program does not contain a static 'Main' method suitable for an entry point" error. If I change the
OutputPath
to anything other than a substring of the source path, all source files are picked up just fine and build succeeds. Issue only happens after the 2nd build (presumably because the output folder is not empty).Still repro'ed on latest stable 2.2, but could not repro on
3.0.100-preview-009812
, so possibly an issue that only affects < 3.0.Repro steps:
Output:
The text was updated successfully, but these errors were encountered: