Enable MSBuild server by default in MSBuildForwardingApp#55231
Enable MSBuild server by default in MSBuildForwardingApp#55231JanProvaznik wants to merge 2 commits into
Conversation
Change DOTNET_CLI_USE_MSBUILD_SERVER to default to true so the MSBuild server is enabled when the user hasn't specified anything about it. An explicit MSBUILDUSESERVER value (or DOTNET_CLI_USE_MSBUILD_SERVER=false) is still respected as an opt-out. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 499249b7-514f-4ecf-88bc-2466455069c5
Test failure analysis: real bug, already fixed upstream, blocked on an MSBuild version lagThe CI test failures on this PR (e.g. Root causeWith This is exactly dotnet/msbuild#14077 ("Fix TerminalLogger auto-detection under MSBuild Server", fixes dotnet/msbuild#13940), merged 2026-06-17, which explicitly calls out the Windows Reproduction (pure CLI, no test harness)Using the SDK built from this branch, a redirected
Deterministic, reproduces without any test framework. Verified end-to-end that the daily .NET 11 SDK ( Why CI still fails (the blocker)The SDK builds against / redistributes MSBuild via That MSBuild is source-dated 2026-06-11 — six days before the fix. Note this is out of sync with What would unblock itThe SDK needs a post-#14077 MSBuild (>= Happy to do whichever the maintainers prefer. |
…ild#14077) The SDK redistributed MSBuild 18.9.0-preview-26311-113 (source-dated 2026-06-11), which predates the TerminalLogger-under-MSBuild-Server fix (dotnet/msbuild#14077, merged 2026-06-17). With the server enabled by default, that bug caused integration tests capturing 'dotnet build' output to fail. Version.Details.props lagged behind Version.Details.xml (already at 26325-102); this aligns them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 499249b7-514f-4ecf-88bc-2466455069c5
Update: MSBuild bump to 26325 fixed the Windows TL failures; residual failures are a separate Unix server bugPushed Remaining 3 failures (all Unix)
The first two are the same root cause, and it is not the TerminalLogger bug: with the server enabled on Unix, an MSBuild invocation that succeeds (0 errors, Net
This looks like it needs an upstream MSBuild fix (or confirmation that these are acceptable/known-flaky) before the server can be defaulted on for Unix. Flagging for maintainer guidance. |
Local repro investigation of the residual Unix failures (WSL Ubuntu 24.04)To determine whether a newer MSBuild would fix the two Unix "exit code 1 on a successful build" failures, I tried to reproduce them locally with the exact SDK CI uses (
So the exit-code race is rare and timing/parallelism-dependent — it did not reproduce once locally, yet CI hits ~1 test per run (a different test each time). I therefore can't confirm locally whether bumping MSBuild further (e.g. to Summary for maintainers
|
Summary
Makes the MSBuild server enabled by default in
MSBuildForwardingApp. When the user hasn't specified anything about the MSBuild server, it is now turned on.Changes
DOTNET_CLI_USE_MSBUILD_SERVERnow defaults totrue(wasfalse).MSBUILDUSESERVER=1is only forced on when the user hasn't already setMSBUILDUSESERVERthemselves, so an explicit opt-out (MSBUILDUSESERVER=0) orDOTNET_CLI_USE_MSBUILD_SERVER=falseis still respected.ItEnablesMSBuildServerByDefaulttest verifying the default-on behavior.Behavior change
DOTNET_CLI_USE_MSBUILD_SERVER=falseorMSBUILDUSESERVER=0.Testing
Ran
GivenMsbuildForwardingApplocally against a full Debug build; the new test passes and existing server-related tests pass.