Skip to content

Linux: System.Diagnostics.ProcessStartInfo: With UseShellExecute = true, a misleading exception is thrown when no helper utility (such as xdg-open) is present. #96565

Description

@mklement0

Description

On Linux distros, opening a document or folder path via UseShellExecute = true relies on external helper utilities; specifically, the following ones are looked for, via the Path environment variable, in order, with the first one getting used: xdg-open, gnome-open, kfmclient

In the absence of these helper utilities, an exception is thrown, which makes sense,
but the exception is misleading, as it reports the .FileName property value as nonexistent.

That is, the nonexistence of a helper utility is mistakenly reported as the the .FileName property value's nonexistence (even if the latter actually exists).

Reproduction Steps

On a Linux distro with none of the helper utilities present (if a helper utility is present, the call should open the current directory GUI shell's file manager):

System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo { FileName = ".", UseShellExecute = true })

Expected behavior

An exception that indicates the absence of a required helper utility.

Actual behavior

E.g. when run from /tmp:

An error occurred trying to start process '.' with working directory '/tmp'. No such file or directory

Regression?

No response

Known Workarounds

No response

Configuration

  • .NET 8.0.0
  • CBL-Mariner/Linux 2.0

Other information

No response

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 5, 2024
  2. added this to the Future milestone on Apr 29, 2024
  3. added
    help wanted[up-for-grabs] Good issue for external contributors
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Apr 29, 2024
  4. added
    in-prThere is an active PR which will close this issue when it is merged
    on May 20, 2026
  5. Neo-vortex commented on May 20, 2026

    @Neo-vortex
    Contributor

    @jozkee
    I made a simple check by validating if the returned util pass in not null

  6. modified the milestones: Future, 11.0.0 on Aug 13, 2026
  7. added a commit that references this issue on Aug 13, 2026
    0edd2d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Diagnostics.Processhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions