[Mono-winforms-list] Running Executable (.exe) using Process.Start on Linux

Rafael Teixeira monoman at gmail.com
Thu Jan 29 10:15:02 EST 2009


If mysqldupm.exe is a managed exe you need to call mono passing it as
parameter (exe files aren't executable files in Linux), you can also create
a shell script that call mono passing the exefile, and use the script name
in your Process call.

If mysqldump.exe is a native windows program it can't be executed in linux,
but you can see if there is some equivalent program for linux and call it
instead (it might be called "mysqldump" without the ".exe" part for
instance).

Hope it helps,

On Thu, Jan 29, 2009 at 11:22 AM, aifaz <aifaz.khan at gmail.com> wrote:

>
> hello
> i have developed windows application using c# .net 2005 .
> it worked fine with mono 2.0 on windows,but when i run it on linux using
> mono 2.0
> i got an error message
>
> AppliactionName='/shared/application/mysqldump.exe',CommandLine='-...',CurrentDirectory="]
>
> this is becuse we acess exe file
>
> here is some code where not execute proper
>
> //
>
>    string locn = Application.StartupPath + "\\mysqldump.exe";
>                ProcessStartInfo info = new ProcessStartInfo(locn);
>                info.Arguments = path;
>                info.RedirectStandardInput = false;
>                info.RedirectStandardOutput = true;
>                //info.Password= "swarup";
>                // info.FileName ="cmd.exe";
>                info.UseShellExecute = false;
>                info.WindowStyle = ProcessWindowStyle.Minimized;
>                //  info.Arguments = path;
>                info.CreateNoWindow = true;
>                info.RedirectStandardError = true;
>                Process process = Process.Start(info);
>
>                //Process process = new Process();
>                //process.StartInfo = info;
>                //process.StartInfo.FileName = filename;
>                //process.Start();
>                swriter.Write(process.StandardOutput.ReadToEnd());
>                process.WaitForExit();
>                if (process.ExitCode != 0)
>                    throw new Exception(process.StandardError.ReadToEnd());
>                process.Close();
>                swriter.Close();
>                ostrm.Close();
> //
>
> i have been hoping for earliar response .
> Thank you
> --
> View this message in context:
> http://www.nabble.com/Running-Executable-%28.exe%29-using-Process.Start-on-Linux-tp21726754p21726754.html
> Sent from the Mono - WinForms mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>



-- 
Rafael "Monoman" Teixeira
---------------------------------------
"I myself am made entirely of flaws, stitched together with good
intentions."
Augusten Burroughs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090129/61f9191c/attachment.html 


More information about the Mono-winforms-list mailing list