Skip to content

make SdkResolver try to locate the dotnet host closest to the resolved SDK #49772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

baronfel
Copy link
Member

Fixes #49363

Before we always returned the dotnet.exe from PATH, but especially in cases where the user has set a local path in global.json this may not be correct. To help ensure better host alignment we try to prefer hosts from within the resolved sdk root's parent directory heirarchy.

Copy link
Member

@dsplaisted dsplaisted left a comment

Choose a reason for hiding this comment

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

Looks good. Does it make sense to add test coverage?

@baronfel
Copy link
Member Author

definitely - there are some existing that @surayya-MS already had as part of this initial implementation that would be good to expand on

@baronfel baronfel force-pushed the sdk-resolver-dotnet-exe-relative-to-resolved-sdk branch 2 times, most recently from 3c260af to efa2005 Compare July 16, 2025 00:10
@baronfel
Copy link
Member Author

Alright - I've added a test that covers the new scenario! This is good to merge as soon as the dang containerbased linux leg stops hanging.

@baronfel baronfel marked this pull request as ready for review July 16, 2025 00:11
@baronfel baronfel force-pushed the sdk-resolver-dotnet-exe-relative-to-resolved-sdk branch from efa2005 to 402a092 Compare July 16, 2025 01:46
@baronfel baronfel enabled auto-merge (squash) July 16, 2025 03:09
@baronfel baronfel merged commit 43c449f into dotnet:main Jul 16, 2025
27 checks passed
@baronfel baronfel deleted the sdk-resolver-dotnet-exe-relative-to-resolved-sdk branch July 16, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOTNET_EXPERIMENTAL_HOST_PATH set incorrectly with SDK hint paths
2 participants