`-getTargetResult` + `-target` behavior is unexpected
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
`-getTargetResult` will run a target that otherwise would not run.
E.g. Given a project with targets `one` and `two` and the targets have no dependency between them:
```xml
One
Two
```
and given a command line with `-target:one -getTargetResult:two`, both targets will be executed.
The current behavior executes the targets provided to `-getTargetResult` that didn't already execute, after the 'standard' target build order. Essentially there is a secondary chain of targets.
It seems from the discussion that this is not the intended behavior.
My own quick take is that `-getTargetResult` should not itself cause a target to be executed and if a target provided to `-getTargetResult` didn't execute then there is no result to report.
_Originally posted by @jrdodds in https://github.com/dotnet/msbuild/issues/3911#issuecomment-1722378952_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.