[Mono-list] How to start a process? (Crossplatform)

Ian Norton inorton at gmail.com
Thu Jun 6 20:26:05 UTC 2013


I find the binfmt-misc support to be mainly controlled by distro things, so
usually for me invoking ./program.exe will wind up using the archaic mono
installed in /usr. If I were you I'd stick to running mono apps by calling
"mono program.exe args".

One possibly mad idea if the subprocess was a c# one would be to load and
invoke the main method of the exe in a new appdomain.. mad I know.. :)


On 6 June 2013 11:36, Miljenko Cvjetko <mcvjetko at holisticware.net> wrote:

>  Hi
>
> Maybe You should try
>
>    1. wrap in a shell
>     1. create shell file utility (note no exe extension)
>       #!/bin/sh
>       /usr/bin/mono $SOMEPATH/utility.exe "$@"
>        2. chmod +x utility.exe
>        2. register exe as non-native binary
>       1. as root turn on the binfmt module
>       modprobe binfmt
>       2. change  /etc/fstab file:
>       binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc none
>       3. run the following command on boot
>       echo ':CLR:M::MZ::/usr/bin/mono:' >
>       /proc/sys/fs/binfmt_misc/register
>       4.  mark your .exe files as executable in the filesystem as well:
>       this is like step 1.2
>
>
>
> http://www.mono-project.com/Guide:Running_Mono_Applications
>
> cheers
>
> mel
>
>  <http://www.mono-project.com/Guide:Running_Mono_Applications>
> On 2013.06.06 12:08, Sergey Khabibullin wrote:
>
>  Hello, I am trying to start a process in my application.
>
>  Process.Start("utility.exe", "my argument list");
>
>
>
> As you see the "utility.exe" is in the same directory as the application itself.
> Works fine for Windows and some Linux distros. But in other distros I can't start
>
>  the utility just by "utility.exe", and I forced to use "mono utility.exe". I belive this behaveour
> is because of that in some distros mono binaries registered as executable files, and in others not.
>
>
> Obviously I can't force all users to use "Proper Linux Distro", and I can't always use "mono" prefix,
>
> or I lose the Windows platform. Is there any solution to this problem?
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-list
>
>
>
> --
> Miljenko Cvjetko dipl.ing. ET
> 	Direktor/CEO
> 	Projektant rješenja/Solution Architect	
> 	Razvojni programer/Senior developer
> 	Voditelj projekta/Project Manager
>
> IX južna obala 13
> Kajzerica Zagreb
> T: 385 1 7775555
> M: 385 91 557 447 3
> F: 385 1 7779556
> e: mcvjetko at holisticware.net
> w: http://holisticware.net
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130606/589dc10a/attachment.html>


More information about the Mono-list mailing list