dotnet / dotnet/msbuild

API to find `dotnet` host executable

Open
#9,018 0 comments 0 reactions 0 assignees View on GitHub
backlog Priority:2 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

> Historically our guidance (given to us by other teams) was to try to not parse PATH and make sense out of it
>
> Yeah I'm not really thrilled about parsing `$PATH` either. Ended up just stealing the code from [msbuild that does it](https://github.com/dotnet/msbuild/blob/main/src/Utilities/ToolTask.cs#L1259). This is essentially how our entire build tool stack works today so it seems like a good source to draw some.
>
> Would be nice to have an API for `FindOnPath` but that seems unlikely. Also I'd still have to polyfill that for downlevel targets.
>
> @rainersigwald, @baronfel: have you all ever considered exposing a `FindToolPath` on `ToolTask` or MSBuild APIs in general that we could use to find `dotnet`? That way the logic for parsing `$PATH` is centralized.

_Originally posted by @jaredpar in https://github.com/dotnet/runtime/issues/88754#issuecomment-1633029934_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.