Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

PetSerAl
Copy link
Contributor

@PetSerAl PetSerAl commented Nov 19, 2024

Use current dotnet binary from DOTNET_HOST_PATH instead of just dotnet.
Reasons:

  1. Global (in PATH) may not exist (when used Binaries, but not Installers).
  2. Global can have different runtime version.
  3. Consistent with outer tools (csc for example).
    https://github.com/dotnet/roslyn/blob/324fd25331c969cd742ba68eee09ffd4b6fd29e3/src/Compilers/Shared/RuntimeHostInfo.cs#L61-L64
  4. It is documented to be used for that purpose.
    https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_host_path

Copy link
Collaborator

@shocklateboy92 shocklateboy92 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your contribution.

@shocklateboy92 shocklateboy92 merged commit 88e3d9b into belav:main Nov 20, 2024
3 checks passed
@belav belav added this to the 0.30.2 milestone Dec 6, 2024
pisolofin pushed a commit to pisolofin/csharpier-editorconfig that referenced this pull request Dec 14, 2024
Use current `dotnet` binary from `DOTNET_HOST_PATH` instead of just
`dotnet`.
Reasons:
1. Global (in `PATH`) may not exist (when used _Binaries_, but not
_Installers_).
2. Global can have different runtime version.
3. Consistent with outer tools (`csc` for example).

https://github.com/dotnet/roslyn/blob/324fd25331c969cd742ba68eee09ffd4b6fd29e3/src/Compilers/Shared/RuntimeHostInfo.cs#L61-L64
4. It is documented to be used for that purpose.

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-environment-variables#dotnet_host_path
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.

3 participants