Repository navigation
[v3] fix(windows): static builds vswhere.exe -product * - #1149
Merged
Merged
Conversation
vswhere.exe defaults to searching Community, Professional, and Enterprise editions only. CI environments typically install the lightweight Build Tools product which is a separate product type (Microsoft.VisualStudio.Product.BuildTools). Without -products * the tool returns no results and the build fails with "Visual Studio with C++ tools not found". See: https://github.com/microsoft/vswhere/wiki/Find-MSBuild
crazywhalecc
approved these changes
May 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Windows Visual Studio detection for static builds when only “Build Tools” (headless Visual Studio) is installed by making vswhere.exe search across all product SKUs via -products *.
Changes:
- Update the
vswhere.exeinvocation to include-products *so Build Tools installations are discoverable. - Keep existing constraints (
-latest, required VC tools component, JSON output) intact.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
visual studio has headless buildtools which is typically used in build pipelines, for some reason vswhere.exe only knows to look for Enterprise/Professional/Community unless you specify with the parameter
-product *. This allows it to use any VS product to which there is only one other one... buildtools. this is kind of a dumb problem but here we are. this was tested and for sure works, I was building with buildtools in v2 with no issues so in v3 switching to vswhere.exe is where this bug snuck in.