Skip to content

[BuildCheck Suggestion]: Item Glob matching nothing #11610

@JanProvaznik

Description

@JanProvaznik

Summary

Check cases and write a suggestion to escape when there is a * or ? symbol in an item <MyItem Include="mystaryitemstring/*"> when the file matching logic matches nothing or returns it as a string.

Background and Motivation

https://learn.microsoft.com/visualstudio/msbuild/msbuild-special-characters some characters are special in some contexts and it'd be desirable to check when their interpretation runs into edge cases to encourage developers to escape correctly.

Sample issue or antipattern that the check should be flagging

#10715

Sample output

"Item on line X, <MyItem Include="aaa*"> was interpreted as a file glob that matched nothing, if you meant it to be a string, escape special characters according to https://learn.microsoft.com/visualstudio/msbuild/msbuild-special-characters?view=vs-2022"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: BuildCheckBuildCheck SuggestionSuggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck'triaged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions