[Mono-bugs] [Bug 58664][Maj] New - Process cannot be executed when ProcessStartInfo.UseShellExecute is false

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 18 May 2004 14:44:11 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=58664

--- shadow/58664	2004-05-18 14:44:11.000000000 -0400
+++ shadow/58664.tmp.27722	2004-05-18 14:44:11.000000000 -0400
@@ -0,0 +1,81 @@
+Bug#: 58664
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Process cannot be executed when ProcessStartInfo.UseShellExecute is false
+
+In Windows box, ProcessStartInfo.UseShellExecute=false borks.
+
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+using System.Diagnostics;
+using Microsoft.CSharp;
+
+public class Test
+{
+	public static void Main ()
+	{
+			Process mcs=new Process();
+
+			string mcs_output;
+			mcs.StartInfo.FileName="mcs";
+			mcs.StartInfo.CreateNoWindow=true;
+
+			// Comment out this line and it will work fine.
+			mcs.StartInfo.UseShellExecute=false;
+
+			mcs.StartInfo.RedirectStandardOutput=true;
+			try {
+				mcs.Start();
+				mcs_output=mcs.StandardOutput.ReadToEnd();
+				mcs.WaitForExit();
+			} finally {
+				mcs.Close();
+			}
+	}
+}
+
+
+Make sure that calling "mcs" works fine. To make it possible, I made
+mcs.bat in install/bin.
+
+$ cat /usr/local/bin/mcs.bat
+mono C:/cygwin/usr/local/lib/mono/1.0/mcs.exe %1 %2 %3 %4 %5
+
+I have no other "mcs" executables except for "mcs" script that works under
+cygwin but does not work under Windows.
+
+Actual Results:
+$ !mono
+mono codecomp.exe
+
+Unhandled Exception: System.ComponentModel.Win32Exception: Some sort of w32
+error occurred: 5
+in <0x003e5> System.Diagnostics.Process:Start_common
+(System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
+in <0x00015> System.Diagnostics.Process:Start ()
+in <0x00054> (wrapper remoting-invoke-with-check)
+System.Diagnostics.Process:Start ()
+in <0x000af> Test:Main ()
+
+
+Expected Results:
+
+Successfully done.
+
+Additional Information:
+
+When I set UseShellExecute=true, the problem does not happen.