Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Set dotnet_root_<arch> always - #15266

#15266
Merged
nohwnd merged 3 commits into
microsoft:mainmicrosoft/vstest:mainfrom
nohwnd:fix-dotnet-root-for-xunitnohwnd/vstest:fix-dotnet-root-for-xunitCopy head branch name to clipboard
Aug 19, 2025
Merged

Set dotnet_root_<arch> always#15266
nohwnd merged 3 commits into
microsoft:mainmicrosoft/vstest:mainfrom
nohwnd:fix-dotnet-root-for-xunitnohwnd/vstest:fix-dotnet-root-for-xunitCopy head branch name to clipboard

Conversation

@nohwnd

@nohwnd nohwnd commented Aug 19, 2025

Copy link
Copy Markdown
Member

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=1

Related issue

Will fix dotnet/sdk#50331 once merged and flown.

Working:

image

Reverting to broken behavior with the feature flag:

image

@nohwnd

nohwnd commented Aug 19, 2025

Copy link
Copy Markdown
Member Author

note for me:

tested on wsl with rc1 release , patched with the newly built testruntime provider.
cp /mnt/s/p/vstest/artifacts/bin/Microsoft.TestPlatform.TestHostProvider/Debug/netstandard2.0/Microsoft.TestPlatform.TestHostRuntimeProvider.dll dotnet3/sdk/10.0.100-rc.1.25418.110/Extensions/Microsoft.TestPlatform.TestHostRuntimeProvider.dll

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff is kinda hard to follow with, but reading the overall logic, LGTM.

@nohwnd
nohwnd enabled auto-merge (squash) August 19, 2025 15:45
@nohwnd
nohwnd merged commit 9cbffb0 into microsoft:main Aug 19, 2025
6 checks passed
This was referenced Oct 2, 2025
This was referenced Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.