dotnet / dotnet/msbuild

Metadata matching when '@' in file path name sometimes fails to behave as expected

Open
#8,104 4 comments 0 reactions 0 assignees View on GitHub
backlog bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description
Demonstrating issues with msbuild with @ in path names

The steps to reproduce below are a cut down version of the MSBuild files used by Grpc.Tools based projects to demonstate the issue https://github.com/grpc/grpc/issues/30746

All gRPC and protobuf compiler tasks and logic have been removed and the outputs mocked below to simplify and demonstrate a possible bug in MSBuild. ( Original MSBuild files are in: https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets )

Issue: If a directory path contains the '@' character then the item list is wrong - it misses out the files with '@' in their paths.

Two 'workarounds' are included and - using qualified metadata. But this adds a different behaviour to the MSBuild batching. The unqualified metadata should work.

If the directory '@ myfiles' is renamed to 'myfiles' and the mocked data in also edited to remove the '@' then it behaves as expected

### Steps to Reproduce
Files to reproduce the problem are here: https://github.com/tonydnewell/msbuild-issue
together with output demonstrating the issue (output-showing-issue.txt) and ok (output-showing-ok.txt) - the only difference being the '@' in the path.

### Versions & Configurations
Microsoft (R) Build Engine version 17.2.1+52cd2da31 for .NET Framework

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.