Skip to content

Resolve dotnet path from DOTNET_HOST_PATH in VSTestTask#5

Closed
nohwnd wants to merge 1 commit intomainfrom
fix/vstest-task-resolve-dotnet-host-path
Closed

Resolve dotnet path from DOTNET_HOST_PATH in VSTestTask#5
nohwnd wants to merge 1 commit intomainfrom
fix/vstest-task-resolve-dotnet-host-path

Conversation

@nohwnd
Copy link
Owner

@nohwnd nohwnd commented Mar 6, 2026

Summary

VSTestTask (legacy) was hardcoding "dotnet" as the process filename, assuming it would be found on PATH. This changes it to resolve the dotnet executable using the same strategy as VSTestTask2.GenerateFullPathToTool():

  1. Check DOTNET_HOST_PATH environment variable
  2. Check current directory for dotnet executable
  3. Search PATH
  4. Fall back to bare dotnet name

Validation

  • Built with ./build.cmd -pack
  • Ran RunDotnetTestWithCsproj acceptance test - 2/2 passed

VSTestTask (legacy) was hardcoding 'dotnet' as the process filename,
assuming it would be found on PATH. This changes it to resolve the
dotnet executable using the same strategy as VSTestTask2:

1. Check DOTNET_HOST_PATH environment variable
2. Check current directory
3. Search PATH
4. Fall back to bare 'dotnet' name

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nohwnd nohwnd closed this Mar 6, 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

Development

Successfully merging this pull request may close these issues.

1 participant