Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MsBuild Path for BuildTools is not recognized correctly #4231

Open
2 tasks done
christianbumann opened this issue Oct 12, 2023 · 0 comments
Open
2 tasks done

MsBuild Path for BuildTools is not recognized correctly #4231

christianbumann opened this issue Oct 12, 2023 · 0 comments

Comments

@christianbumann
Copy link

christianbumann commented Oct 12, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

3.1

Operating system

Windows

Operating system architecture

X64

CI Server

TeamCity / Azure DevOps Server (On Prem)

What are you seeing?

Running the Cake Alias "MsBuild" on a machine where only BuildTools are installed can fail

`MSBuild: Could not locate executable.
   at Cake.Core.Tooling.Tool`1.RunProcess(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 164
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 81
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 60
   at Cake.Common.Tools.MSBuild.MSBuildRunner.Run(FilePath solution, MSBuildSettings settings) in C:\projects\cake\src\Cake.Common\Tools\MSBuild\MSBuildRunner.cs:line 48
   at Cake.Common.Tools.MSBuild.MSBuildAliases.MSBuild(ICakeContext context, FilePath solution, MSBuildSettings settings) in C:\projects\cake\src\Cake.Common\Tools\MSBuild\MSBuildAliases.cs:line 102
   at Submission#0.MSBuild(FilePath solution, MSBuildSettings settings)

In this PR https://github.com/cake-build/cake/pull/3795/files this was changed to "Program Files (x86)"

But it is also possible that the BuildTools are installed on "Program Files" Directory (image)

msbuild

This is now the new behavior
https://learn.microsoft.com/en-us/visualstudio/msbuild/whats-new-msbuild-17-0?view=vs-2022

What is expected?

Detection of the correct directory

Steps to Reproduce

Windows Server 2022

image

Output log

No response

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

No branches or pull requests

1 participant