Skip to content

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

@mthalman

Description

@mthalman

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions