Skip to content

Use architecture-appropriate desktop MSBuild and remove Prefer64bit switch#17026

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/dotnet-arcade-use-x64-msbuild
Open

Use architecture-appropriate desktop MSBuild and remove Prefer64bit switch#17026
Copilot wants to merge 3 commits into
mainfrom
copilot/dotnet-arcade-use-x64-msbuild

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Desktop MSBuild was always launched as x86, even on amd64/arm64 hosts. The Prefer64bit opt-in (from #7531) never became the default, so the x64 MSBuild was effectively unreachable, and arm64 was never considered.

GetMSBuildExe in eng/common/tools.ps1 now selects the desktop MSBuild matching the host process architecture:

  • Architecture detection — reads PROCESSOR_ARCHITECTURE, falling back to PROCESSOR_ARCHITEW6432 so a 32-bit process on a 64-bit OS resolves the real machine arch.
  • Subfolder mappingAMD64amd64\msbuild.exe, ARM64arm64\msbuild.exe; anything else uses the root (32-bit) msbuild.exe.
  • Safe fallback — if the arch-specific subfolder isn't present, falls back to the root msbuild.exe.
  • Removed the Prefer64bit switch and its read from global.json (tools.vs), since arch-appropriate selection is now unconditional.

To double check:

Copilot AI requested review from Copilot and removed request for Copilot June 18, 2026 16:12
Copilot AI requested review from Copilot and removed request for Copilot June 18, 2026 16:15
Copilot AI changed the title [WIP] Use x64 version of desktop msbuild if process arch is amd64 Use architecture-appropriate desktop MSBuild (amd64/arm64) by default Jun 18, 2026
Copilot AI requested a review from ViktorHofer June 18, 2026 16:16
Copilot AI requested review from Copilot and removed request for Copilot June 18, 2026 16:19
Copilot AI changed the title Use architecture-appropriate desktop MSBuild (amd64/arm64) by default Use architecture-appropriate desktop MSBuild and remove Prefer64bit switch Jun 18, 2026
@ViktorHofer ViktorHofer marked this pull request as ready for review June 18, 2026 16:21
@ViktorHofer ViktorHofer requested review from Copilot and mmitche June 18, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Arcade’s Visual Studio MSBuild discovery to select a desktop msbuild.exe that matches the effective host architecture (including WOW64 scenarios), removing the previous Prefer64bit opt-in path that made non-x86 MSBuild effectively unreachable in many cases.

Changes:

  • Update InitializeVisualStudioMSBuild to choose Bin\amd64\msbuild.exe or Bin\arm64\msbuild.exe based on host/process environment architecture, with a safe fallback to Bin\msbuild.exe.
  • Remove the Prefer64bit selection logic.
Show a summary per file
File Description
eng/common/tools.ps1 Updates MSBuild exe selection to be architecture-appropriate by default and removes the Prefer64bit switch logic.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants