mono / monodevelop

MonoDevelop is a cross platform .NET IDE
http://www.monodevelop.com
2.84k stars 1.02k forks source link

Solution Explorer : Open Containing Folder stopped working #9617

Closed htconst closed 3 years ago

htconst commented 4 years ago

This is not a complaint, just something that I think you should know about. After the recent update of Mono a few days ago, the Open Containing Folder does not work anymore. I am using Linux Mint 19.3 with the Cinnamon desktop === Linux info ($ cat /etc/*-release)

DISTRIB_ID=LinuxMint DISTRIB_RELEASE=19.3 DISTRIB_CODENAME=tricia DISTRIB_DESCRIPTION="Linux Mint 19.3 Tricia" NAME="Linux Mint" VERSION="19.3 (Tricia)" ID=linuxmint ID_LIKE=ubuntu PRETTY_NAME="Linux Mint 19.3" VERSION_ID="19.3" HOME_URL="https://www.linuxmint.com/" SUPPORT_URL="https://forums.ubuntu.com/" BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/" PRIVACY_POLICY_URL="https://www.linuxmint.com/" VERSION_CODENAME=tricia UBUNTU_CODENAME=bionic

and the MonoDevelop info is the following: === MonoDevelop ===

Version 7.8.4 (build 2) Installation UUID: 7676fad0-d6dd-4b93-9b35-2114a80e1bb7 GTK+ 2.24.32 (Mint-Y theme)

=== Mono Framework MDK ===

Runtime: Mono 6.6.0.166 (tarball Mon Mar 2 18:12:59 UTC 2020) (64-bit)

=== NuGet ===

Version: 4.8.2.5835

=== .NET Core ===

Runtime: /usr/share/dotnet/dotnet Runtime Versions: 3.0.2 2.1.15 SDK: /usr/share/dotnet/sdk/3.0.102/Sdks SDK Versions: 3.0.102 2.1.803 MSBuild SDKs: /usr/lib/mono/msbuild/15.0/bin/Sdks

=== Build Information ===

Release ID: 708040002 Git revision: 622db12503514afdb641c31615408bfe905a7312 Build date: 2019-07-17 17:02:07-04

=== Operating System ===

Linux Linux 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64

=== Enabled user installed extensions ===

GTK# 3 Simple Project Template 0.2.0

===

htconst commented 4 years ago

I think I have found the cause: I suspect it has something to do with Shell Execute. I have a Gtk# 3 application that up until a few days ago would launch a browser thus: e.g. System.Diagnostics.Process.Start("http://www.github.com");

Today I discovered that the above code now throws an exception: System.ComponentModel.Win32Exception: Cannot find the specified file at System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) etc...

So, I assume that something similar is happening with MonoDevelop not being able to Open the Containing Folder. As an aside, I modified my code to the following, and this works.

        using( Process proc = new Process() )
        {
            proc.StartInfo.UseShellExecute = true; 
            proc.StartInfo.CreateNoWindow = true;
            proc.StartInfo.FileName  = "firefox"; 
            proc.StartInfo.Arguments = "http://www.github.com";
            proc.Start();
        }

Hope this helps.

htconst commented 3 years ago

Mono version 6.12.0.122 fixes this issue: MonoDevelop's "Open Containing Folder" works again, and the System.Diagnostics.Process.Start("http://www.github.com"); works again as well.