Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I launch a .NET exe in a new process in a cross-platform way?

I have a .NET application that I need to launch into its own process from another .NET application. If I only cared about it working on Windows, it's easy, I can just use System.Diagnostics.Process.Start, specify the path to my exe, and I'm good to go.

The trick is, this is for a MonoDevelop addin, so I need to do this is a way that works across platforms, and on Mac and Linux you can't count on the OS knowing what to do with a .NET assembly without some help (ie, calling mono myapp.exe).

Since this is for a MonoDevelop addin, an answer making use of the Mono or MonoDevelop libraries would be acceptable.

like image 987
scott Avatar asked Dec 27 '22 10:12

scott


1 Answers

If you use Process.Start from Mono on a .NET executable, it will be run with Mono automatically. It will not be passed directly to the OS.

like image 177
Mikayla Hutchinson Avatar answered Jan 18 '23 23:01

Mikayla Hutchinson