Floating working dir in Rhino8 .NETCore ? (Process.Start)

Is this expected when running R8 in .NETCore?
It’s interesting as when I try to run “http://someweb.com” It crashes with:

[ERROR] FATAL UNHANDLED EXCEPTION: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'http://someweb.com' with working directory 'C:\ProgramData\McNeel\Rhinoceros\7.0\Plug-ins'. Could not find the file.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)

With .NETFramework it works without issue. BESIDES hows that in R8 .NETCore working dir is set to R7 Plugins?

To be precise it occurs with Rhino 8 SR5 2024-3-12 (Rhino 8, 8.5.24072.13001, Git hash:master @ e3530849b75f00b2b977766a567ae29b055837e9)

Hey, we had this too - its a .net change for security reasons & not due to Rhino.

We now use this, for more info see issue link below:

public static class SystemExtensions {
	public static void OpenUrl(string url) {
		if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) return;

		// see: https://github.com/dotnet/corefx/issues/10361
		if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) {
			url = url.Replace("&", "^&");
			Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
		} else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {
			Process.Start("xdg-open", url);
		} else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
			Process.Start("open", url);
		}
	}
}
2 Likes