+2008-06-21 Robert Jordan <robertj@gmx.net>
+
+ * Process.cs (Start_common): UserName may be null or empty.
+ Fixes bug #350543.
+
2008-06-19 Dick Porter <dick@ximian.com>
* Process.cs: Match the buffer sizes of StreamReader and
if (startInfo.UseShellExecute) {
#if NET_2_0
- if (startInfo.UserName != null)
+ if (!String.IsNullOrEmpty (startInfo.UserName))
throw new InvalidOperationException ("UserShellExecute must be false if an explicit UserName is specified when starting a process");
#endif
return (Start_shell (startInfo, process));
+2008-06-21 Robert Jordan <robertj@gmx.net>
+
+ * ProcessTest.cs (Start_UseShellExecuteWithEmptyUserName):
+ add test for bug #350543.
+
2008-06-11 Atsushi Enomoto <atsushi@ximian.com>
* FileVersionInfoTest.cs : disabled all English-Windows-dependent
}
}
+#if NET_2_0
+ [Test]
+ public void Start_UseShellExecuteWithEmptyUserName ()
+ {
+ if (RunningOnUnix)
+ Assert.Ignore ("On Unix and Mac OS X, we try " +
+ "to open any file (using xdg-open, ...)" +
+ " and we do not report an exception " +
+ "if this fails.");
+
+ string exe = @"c:\shouldnoteverexist.exe";
+
+ try {
+ Process p = new Process ();
+ p.StartInfo.FileName = exe;
+ p.StartInfo.UseShellExecute = true;
+ p.StartInfo.UserName = "";
+ p.Start ();
+ Assert.Fail ("#1");
+ } catch (InvalidOperationException) {
+ Assert.Fail ("#2");
+ } catch (Win32Exception) {
+ }
+
+ try {
+ Process p = new Process ();
+ p.StartInfo.FileName = exe;
+ p.StartInfo.UseShellExecute = true;
+ p.StartInfo.UserName = null;
+ p.Start ();
+ Assert.Fail ("#3");
+ } catch (InvalidOperationException) {
+ Assert.Fail ("#4");
+ } catch (Win32Exception) {
+ }
+ }
+#endif
+
[Test] // Start (string, string)
public void Start4_FileName_Null ()
{