Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can no-longer open URLs with System.Diagnostics.Process.Start() #19836

@mavit

Description

@mavit

Steps to Reproduce

using System.Diagnostics;

public class ProcessStart
{
    public static void Main(string[] args)
    {
        Process.Start("https://www.mono-project.com/");
    }
}

Current Behavior

Calling System.Diagnostics.Process.Start() on a URL throws an exception containing the message Cannot find the specified file.

Expected Behavior

In earlier Mono versions, the URL was passed to xdg-open which opened the URL in the user's preferred web browser.

On which platforms did you notice this

[ ] macOS
[x] Linux
[ ] Windows

Version Used:

The issue is seen on Fedora 32 (which has the following Mono version):

Mono JIT compiler version 6.6.0.161 (tarball Wed Feb  5 07:34:41 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          supported, not enabled.
        Suspend:       hybrid
        GC:            sgen (concurrent by default)

The issue is not present on Fedora 31:

Mono JIT compiler version 5.20.1.34 (tarball Mon Oct 14 05:16:35 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug 
        Interpreter:   yes
        LLVM:          supported, not enabled.
        Suspend:       hybrid
        GC:            sgen (concurrent by default)

Stacktrace

Unhandled Exception:
System.ComponentModel.Win32Exception (0x80004005): Cannot find the specified file
  at System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) [0x00129] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at System.Diagnostics.Process.Start () [0x00038] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
  at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x0001e] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at System.Diagnostics.Process.Start (System.String fileName) [0x00006] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at ProcessStart.Main (System.String[] args) [0x00000] in <d39a2c4d79a54779ba47e4b3fcb2e079>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ComponentModel.Win32Exception (0x80004005): Cannot find the specified file
  at System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) [0x00129] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at System.Diagnostics.Process.Start () [0x00038] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
  at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x0001e] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at System.Diagnostics.Process.Start (System.String fileName) [0x00006] in <13e87ee1a85d4b5e8544328288bab252>:0 
  at ProcessStart.Main (System.String[] args) [0x00000] in <d39a2c4d79a54779ba47e4b3fcb2e079>:0 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions