[BuildCheck Suggestion]: Detect use of Exec task to run "dotnet build" or similar commands #11125
Labels
Area: BuildCheck
backlog
BuildCheck Suggestion
Suggestion for a built in MSBuild analyzer. Label should be applied together with 'Area: BuildCheck'
help wanted
Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim.
internal-team-onboarding
triaged
Summary
We should warn when an
Exec
task is used to spawn a new build viadotnet build
,dotnet publish
, etc.Background and Motivation
It's usually a bad pattern to run
dotnet build
,dotnet publish
, etc from anExec
task, since this spawns an entirely separate build that the MSBuild engine doesn't have visibility over. We should recommend using anMSBuild
task instead.Sample issue or antipattern that the check should be flagging
Source: dotnet/sdk#45034 (comment)
Sample output
No response
The text was updated successfully, but these errors were encountered: