scott
scott

Reputation: 1277

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.

Upvotes: 4

Views: 358

Answers (2)

Lluis Sanchez
Lluis Sanchez

Reputation: 1737

You can also use MonoDevelop.Core.Runtime.ProcessService.StartProcess()

Upvotes: 4

Mikayla Hutchinson
Mikayla Hutchinson

Reputation: 16153

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.

Upvotes: 6

Related Questions