64-bit MSBuild.exe is not used when custom process is 64-bit

Open
#133 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
build-system

Research direction

Inspect the MSBuildLocator logic that selects MSBuild.exe for a custom process, using the reported AnyCPU configuration with Prefer32Bit disabled as the starting case. Reproduce the out-of-proc build failure and verify that a 64-bit process selects the 64-bit MSBuild.exe rather than the x86 installation.

Written by the indexing model from the issue text.

Description

If you create a custom application that is AnyCPU but prefer 32-bit is set to false, then MSBuild locator will register the 32-bit MSBuild. This breaks out-of-proc builds with an error like this:

Build was canceled. Failed to successfully launch or connect to a child MSBuild.exe process. 
Verify that the MSBuild.exe "C:\Program Files (x86)\Visual Studio 2019 Preview\MSBuild\Current\Bin\MSBuild.exe"
 launches successfully, and that it is loading the same microsoft.build.dll that the launching process loaded.
 If the location seems incorrect, try specifying the correct location in the BuildParameters object, or with
 the MSBUILD_EXE_PATH environment variable.

This is because the handshake between the 64-bit application and the 32-bit MSBuild.exe doesn't match up. MSBuildLocator should use the 64-bit MSBuild.exe if Environment.Is64BitProcess is true

Dominant language
C#
Stars
262
Forks
91
Avg merge
11d 22h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/MSBuildLocator

All issues in microsoft/MSBuildLocator

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.