Skip to content

Search for the VS install with the compiler package matching the target arch - #217

Merged
AaronRobinsonMSFT merged 4 commits into
AaronRobinsonMSFT:masterfrom
jtschuster:fix-host-bin-dir-check
Apr 17, 2026
Merged

AaronRobinsonMSFT merged 4 commits into
AaronRobinsonMSFT:masterfrom
jtschuster:fix-host-bin-dir-check

Conversation

@jtschuster

@jtschuster jtschuster commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

DNNE searches for the newest VS with either x64 or arm64 compiler packages, no matter the target. Instead, search for the newest VS with the compiler package that matches the target of the compilation.

See dotnet/runtime#126673 and dotnet/runtime#126847

@MichalStrehovsky

Copy link
Copy Markdown

FWIW, in native AOT, we simply call vswhere.exe to find vcvarsall, and then we run it to set up paths in the documented environment variables and pull it out of that. Plus we have an opt out mechanism to skip all of that: https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/BuildIntegration/findvcvarsall.bat

@AaronRobinsonMSFT

Copy link
Copy Markdown
Owner

FWIW, in native AOT, we simply call vswhere.exe to find vcvarsall, and then we run it to set up paths in the documented environment variables and pull it out of that. Plus we have an opt out mechanism to skip all of that: https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/BuildIntegration/findvcvarsall.bat

I'm using the COM server that vswhere.exe uses. It is the same thing, but I don't need to process create.

@jtschuster
jtschuster force-pushed the fix-host-bin-dir-check branch from fc89f27 to 884b8c6 Compare April 15, 2026 21:56
@jtschuster jtschuster changed the title Fix MSVC toolchain selection to match vcvarsall.bat behavior Search for the VS install with the compiler package matching the target arch Apr 16, 2026
Comment thread src/msbuild/DNNE.BuildTasks/Windows.cs Outdated
@AaronRobinsonMSFT
AaronRobinsonMSFT merged commit bfeef36 into AaronRobinsonMSFT:master Apr 17, 2026
6 checks passed
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