dotnet / dotnet/sdk

`dnx` dispatcher script fails when invoked via the `/usr/bin/dnx` symlink

Open
#54,687 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

## 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//dotnet.dll` instead of `/usr/share/dotnet/sdk//dotnet.dll`.

Regression introduced by https://github.com/dotnet/sdk/pull/54472.

## Repro

```console
$ /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//dotnet.dll'
```

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.