Commit b481c50
Fix task host launch regressions from apphost support (#13325)
## Summary
Fixes three regressions introduced by #13175 (Add App Host Support for
MSBuild, commit c8011cb).
## Bug 1: CLR2 task host (MSBuildTaskHost.exe) broken - VS build
failures
**Root cause**: `NodeLauncher.ResolveExecutableName` only recognized
`MSBuild.exe` (`Constants.MSBuildExecutableName`) as a native
executable. Any other `.exe` - including `MSBuildTaskHost.exe` - was
treated as a managed assembly and routed through `dotnet.exe`. Since
`MSBuildTaskHost.exe` is a standalone .NET Framework 3.5 executable,
`dotnet.exe` cannot host it.
## Bug 2: .NET task host fallback broken when `DotnetHostPath` is null
**Symptom**: `MSB4216: ... the required executable
"...\sdk\11.0.100-ci\MSBuild.exe" exists and can be run` - in CI where
the apphost hasn't been created yet.
**Root cause**: `ResolveAppHostOrFallback` correctly detects the missing
apphost and tries to fall back to `dotnet MSBuild.dll`, but
`TaskHostParameters.DotnetHostPath` is null (not populated by
`AssemblyTaskFactory`). This produces `NodeLaunchData(null, ...)` which
silently fails in `CreateNode`.
## Bug 3: MSB4216 error shows wrong executable path for .NET task hosts
**Root cause**: `LogErrorUnableToCreateTaskHost` in `TaskHostTask.cs`
has a `#if NETFRAMEWORK` guard around the .NET task host path
resolution. On .NET Core (the common case), it always falls through to
`GetMSBuildExecutablePathForNonNETRuntimes` which returns the non-.NET
path (`MSBuild.exe`), even for `.NET` task host failures.
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rainer Sigwald <raines@microsoft.com>1 parent 3477e49 commit b481c50
4 files changed
Lines changed: 131 additions & 15 deletions
File tree
- src
- Build.UnitTests
- Build
- BackEnd/Components/Communications
- Instance/TaskFactories
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
88 | 86 | | |
89 | | - | |
90 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
| |||
Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
687 | | - | |
| 686 | + | |
| 687 | + | |
688 | 688 | | |
689 | | - | |
690 | | - | |
691 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
692 | 710 | | |
693 | 711 | | |
694 | 712 | | |
| |||
730 | 748 | | |
731 | 749 | | |
732 | 750 | | |
733 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
734 | 761 | | |
735 | 762 | | |
736 | | - | |
| 763 | + | |
737 | 764 | | |
738 | 765 | | |
739 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | | - | |
704 | | - | |
| 705 | + | |
| 706 | + | |
705 | 707 | | |
706 | 708 | | |
707 | | - | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
708 | 713 | | |
709 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
710 | 719 | | |
711 | 720 | | |
712 | 721 | | |
| |||
0 commit comments