Summary
The dnx dispatcher at src/Layout/redist/dnx computes paths from $(dirname "$0"). In POSIX sh, $0 is the path used to invoke the script — symlinks are not followed. When invoked via /usr/bin/dnx (the standard Linux/macOS package symlink), the script looks for the SDK at /usr/bin/sdk/<ver>/dotnet.dll instead of /usr/share/dotnet/sdk/<ver>/dotnet.dll.
Regression introduced by #54472.
Repro
$ /usr/share/dotnet/dnx --help # direct — works
…dispatches into the SDK…
$ dnx --help # via /usr/bin/dnx — fails
The application to execute does not exist: '/usr/bin/sdk/<ver>/dotnet.dll'
Summary
The
dnxdispatcher atsrc/Layout/redist/dnxcomputes paths from$(dirname "$0"). In POSIXsh,$0is the path used to invoke the script — symlinks are not followed. When invoked via/usr/bin/dnx(the standard Linux/macOS package symlink), the script looks for the SDK at/usr/bin/sdk/<ver>/dotnet.dllinstead of/usr/share/dotnet/sdk/<ver>/dotnet.dll.Regression introduced by #54472.
Repro