Set dotnet_root_<arch> always#15266
Merged
nohwnd merged 3 commits intomicrosoft:mainfrom Aug 19, 2025
Merged
Conversation
Member
Author
|
note for me: tested on wsl with rc1 release , patched with the newly built testruntime provider. |
nohwnd
commented
Aug 19, 2025
src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs
Show resolved
Hide resolved
nohwnd
commented
Aug 19, 2025
src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs
Show resolved
Hide resolved
nohwnd
commented
Aug 19, 2025
src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs
Show resolved
Hide resolved
Youssef1313
reviewed
Aug 19, 2025
src/Microsoft.TestPlatform.TestHostProvider/Hosting/DotnetTestHostManager.cs
Show resolved
Hide resolved
Youssef1313
approved these changes
Aug 19, 2025
Member
Youssef1313
left a comment
There was a problem hiding this comment.
Diff is kinda hard to follow with, but reading the overall logic, LGTM.
drognanar
approved these changes
Aug 19, 2025
This was referenced Oct 2, 2025
Merged
Closed
This was referenced Mar 9, 2026
Closed
Closed
Closed
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.
Description
Always set DOTNET_ROOT_ (e.g. DOTNET_ROOT_X64) when running under dotnet test, to make sure that the location of dotnet".exe", propagates to the testhost and child processes when we are on windows, linux and macos. This allows local installations of dotnet to be used to run tests that run child executables. On Windows this is alread in place for a long time when testhost.exe is found, so it can resolve correctly dotnet that is not in program files.
On Linux and MacOS it will be used to run xunit v3 tests.
There is a feature flag to disable this new behavior:
VSTEST_DISABLE_DOTNET_ROOT_ON_NONWINDOWS=1Related issue
Will fix dotnet/sdk#50331 once merged and flown.
Working:
Reverting to broken behavior with the feature flag: