Description
Summary
We should warn when an Exec
task is used to spawn a new build via dotnet build
, dotnet publish
, etc.
Background and Motivation
It's usually a bad pattern to run dotnet build
, dotnet publish
, etc from an Exec
task, since this spawns an entirely separate build that the MSBuild engine doesn't have visibility over. We should recommend using an MSBuild
task instead.
Sample issue or antipattern that the check should be flagging
<Target Name="BuildVer2022">
<Exec Command="dotnet build -p:C3DVersion=Ver2022 -c $(Configuration)"/>
</Target>
Source: dotnet/sdk#45034 (comment)
Sample output
No response