-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
C#: Resolve the hostfxr path using dotnet CLI #96146
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
C#: Resolve the hostfxr path using dotnet CLI #96146
Conversation
I would prefer this PR with #81266 to avoid hardcoding non-standard hostfxr locations. |
#81266 was merged, so this could now be rebased / retested and should be mergeable. |
Instead of trying to get the location of the dotnet CLI from PATH (which is unavailable in some platforms that don't allow reading environment variables), we execute the dotnet CLI to list the available SDKs and find the hostfxr location that way.
4b660a4
to
5a2c033
Compare
String version_string = sdk.get_slice(" ", 0); | ||
String path = sdk.get_slice(" ", 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String version_string = sdk.get_slice(" ", 0); | |
String path = sdk.get_slice(" ", 1); | |
String version_string = sdk.get_slicec(' ', 0); | |
String path = sdk.get_slicec(' ', 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't get a chance to make the change before the PR got merged.
Thanks! |
Instead of trying to get the location of the dotnet CLI from PATH (which is unavailable in some platforms that don't allow reading environment variables), we execute the dotnet CLI to list the available SDKs and find the hostfxr location that way.