From f52d103767e5321547f2861b8cf930f02c7d787a Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Tue, 16 May 2023 11:41:58 -0700 Subject: [PATCH 1/9] Add ProcessStartInfo constructor that accepts IEnumerable arguments --- .../ref/System.Diagnostics.Process.cs | 1 + .../src/System/Diagnostics/Process.cs | 8 +------- .../src/System/Diagnostics/ProcessStartInfo.cs | 14 ++++++++++++++ .../tests/ProcessStartInfoTests.cs | 12 +++++++++++- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs index ed06fe1dc1ca86..bd58edc786fba1 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -215,6 +215,7 @@ public sealed partial class ProcessStartInfo public ProcessStartInfo() { } public ProcessStartInfo(string fileName) { } public ProcessStartInfo(string fileName, string arguments) { } + public ProcessStartInfo(string fileName, System.Collections.Generic.IEnumerable arguments) { } public System.Collections.ObjectModel.Collection ArgumentList { get { throw null; } } [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public string Arguments { get { throw null; } set { } } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index f62778b8735cb2..02ba07db85e29b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -1330,13 +1330,7 @@ public static Process Start(string fileName, IEnumerable arguments) ArgumentNullException.ThrowIfNull(fileName); ArgumentNullException.ThrowIfNull(arguments); - var startInfo = new ProcessStartInfo(fileName); - foreach (string argument in arguments) - { - startInfo.ArgumentList.Add(argument); - } - - return Start(startInfo)!; + return Start(new ProcessStartInfo(fileName, arguments))!; } /// diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs index b2941f17dfd5aa..20419e3fca0f63 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs @@ -55,6 +55,20 @@ public ProcessStartInfo(string fileName, string arguments) _arguments = arguments; } + /// + /// Specifies the name of the application that is to be started, as well as a set + /// of command line arguments to pass to the application. + /// + public ProcessStartInfo(string fileName, IEnumerable arguments) + { + _fileName = fileName; + + foreach (string argument in arguments) + { + ArgumentList.Add(argument); + } + } + /// /// Specifies the set of command line arguments to use when starting the application. /// diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index 686780fd018d72..305085a8b8cc8a 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -1257,7 +1257,7 @@ public void UninitializedArgumentList() } [Fact] - public void InitializeWithArgumentList() + public void InitializeWithArgumentList_Add() { ProcessStartInfo psi = new ProcessStartInfo("filename"); psi.ArgumentList.Add("arg1"); @@ -1268,6 +1268,16 @@ public void InitializeWithArgumentList() Assert.Equal("arg2", psi.ArgumentList[1]); } + [Fact] + public void InitializeWithArgumentList_Enumerable() + { + ProcessStartInfo psi = new ProcessStartInfo("filename", new[] { "arg1", "arg2" }); + + Assert.Equal(2, psi.ArgumentList.Count); + Assert.Equal("arg1", psi.ArgumentList[0]); + Assert.Equal("arg2", psi.ArgumentList[1]); + } + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // No Notepad on Nano [MemberData(nameof(UseShellExecute))] [OuterLoop("Launches notepad")] From 5c925c7409025f44641976a663bce294be7850ee Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Tue, 16 May 2023 12:52:28 -0700 Subject: [PATCH 2/9] Add more test scenarios --- .../tests/ProcessStartInfoTests.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index 305085a8b8cc8a..d6c60e8e42aa20 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -1262,20 +1262,32 @@ public void InitializeWithArgumentList_Add() ProcessStartInfo psi = new ProcessStartInfo("filename"); psi.ArgumentList.Add("arg1"); psi.ArgumentList.Add("arg2"); + psi.ArgumentList.Add(" arg3"); + psi.ArgumentList.Add("arg4 "); + psi.ArgumentList.Add("arg 5"); + psi.ArgumentList.Add($"arg{Environment.NewLine}6"); - Assert.Equal(2, psi.ArgumentList.Count); + Assert.Equal(6, psi.ArgumentList.Count); Assert.Equal("arg1", psi.ArgumentList[0]); Assert.Equal("arg2", psi.ArgumentList[1]); + Assert.Equal(" arg3", psi.ArgumentList[2]); + Assert.Equal("arg4 ", psi.ArgumentList[3]); + Assert.Equal("arg 5", psi.ArgumentList[4]); + Assert.Equal($"arg{Environment.NewLine}6", psi.ArgumentList[5]); } [Fact] public void InitializeWithArgumentList_Enumerable() { - ProcessStartInfo psi = new ProcessStartInfo("filename", new[] { "arg1", "arg2" }); + ProcessStartInfo psi = new ProcessStartInfo("filename", new[] { "arg1", "arg2", " arg3", "arg4 ", "arg 5", $"arg{Environment.NewLine}6" }); - Assert.Equal(2, psi.ArgumentList.Count); + Assert.Equal(6, psi.ArgumentList.Count); Assert.Equal("arg1", psi.ArgumentList[0]); Assert.Equal("arg2", psi.ArgumentList[1]); + Assert.Equal(" arg3", psi.ArgumentList[2]); + Assert.Equal("arg4 ", psi.ArgumentList[3]); + Assert.Equal("arg 5", psi.ArgumentList[4]); + Assert.Equal($"arg{Environment.NewLine}6", psi.ArgumentList[5]); } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // No Notepad on Nano From dbf7815107c97c8a66ef758ea7845100a2b2af61 Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Tue, 16 May 2023 14:48:33 -0700 Subject: [PATCH 3/9] Simplify collection initialization --- .../src/System/Diagnostics/ProcessStartInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs index 20419e3fca0f63..3ce0646d4ba733 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs @@ -63,9 +63,9 @@ public ProcessStartInfo(string fileName, IEnumerable arguments) { _fileName = fileName; - foreach (string argument in arguments) + if(arguments != null) { - ArgumentList.Add(argument); + _argumentList = new Collection(new List(arguments)); } } From e9c62f9f6e3b83fc30a0b8bc5adda01e58869c59 Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Wed, 17 May 2023 07:05:43 -0700 Subject: [PATCH 4/9] Fix API summary tags --- .../src/System/Diagnostics/ProcessStartInfo.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs index 3ce0646d4ba733..1e0379894a3035 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs @@ -55,10 +55,10 @@ public ProcessStartInfo(string fileName, string arguments) _arguments = arguments; } - /// - /// Specifies the name of the application that is to be started, as well as a set - /// of command line arguments to pass to the application. - /// + /// + /// Specifies the name of the application that is to be started, as well as a set + /// of command line arguments to pass to the application. + /// public ProcessStartInfo(string fileName, IEnumerable arguments) { _fileName = fileName; From 76234493bc0d7ee3a2a2b648e303f648c6c49f25 Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Wed, 17 May 2023 07:05:56 -0700 Subject: [PATCH 5/9] Simplify unit tests --- .../tests/ProcessStartInfoTests.cs | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index d6c60e8e42aa20..1ccdd039e4d7ef 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -1258,36 +1258,25 @@ public void UninitializedArgumentList() [Fact] public void InitializeWithArgumentList_Add() - { + { ProcessStartInfo psi = new ProcessStartInfo("filename"); - psi.ArgumentList.Add("arg1"); - psi.ArgumentList.Add("arg2"); - psi.ArgumentList.Add(" arg3"); - psi.ArgumentList.Add("arg4 "); - psi.ArgumentList.Add("arg 5"); - psi.ArgumentList.Add($"arg{Environment.NewLine}6"); - - Assert.Equal(6, psi.ArgumentList.Count); - Assert.Equal("arg1", psi.ArgumentList[0]); - Assert.Equal("arg2", psi.ArgumentList[1]); - Assert.Equal(" arg3", psi.ArgumentList[2]); - Assert.Equal("arg4 ", psi.ArgumentList[3]); - Assert.Equal("arg 5", psi.ArgumentList[4]); - Assert.Equal($"arg{Environment.NewLine}6", psi.ArgumentList[5]); + + string[] args = new[] { "arg1", "arg2", " arg3", "arg4 ", "arg 5", $"arg{Environment.NewLine}6" }; + foreach (string arg in args) + { + psi.ArgumentList.Add(arg); + } + + Assert.Equal(args, psi.ArgumentList); } [Fact] public void InitializeWithArgumentList_Enumerable() { - ProcessStartInfo psi = new ProcessStartInfo("filename", new[] { "arg1", "arg2", " arg3", "arg4 ", "arg 5", $"arg{Environment.NewLine}6" }); - - Assert.Equal(6, psi.ArgumentList.Count); - Assert.Equal("arg1", psi.ArgumentList[0]); - Assert.Equal("arg2", psi.ArgumentList[1]); - Assert.Equal(" arg3", psi.ArgumentList[2]); - Assert.Equal("arg4 ", psi.ArgumentList[3]); - Assert.Equal("arg 5", psi.ArgumentList[4]); - Assert.Equal($"arg{Environment.NewLine}6", psi.ArgumentList[5]); + string[] args = new[] { "arg1", "arg2", " arg3", "arg4 ", "arg 5", $"arg{Environment.NewLine}6" }; + ProcessStartInfo psi = new ProcessStartInfo("filename", args); + + Assert.Equal(args, psi.ArgumentList); } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // No Notepad on Nano From bd456424c7e72bb826ccb913e11bd79c3d18f5ba Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Wed, 17 May 2023 08:27:48 -0700 Subject: [PATCH 6/9] Refactor various call sites to use new overload --- .../tests/System/Environment.Exit.cs | 5 +---- .../DebuggerTestSuite/TestHarnessStartup.cs | 14 ++++++-------- .../Loader/binding/tracing/BinderTracingTest.cs | 4 +--- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs b/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs index aa1a0d110930bb..063de534bf765b 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Environment.Exit.cs @@ -45,11 +45,8 @@ public static void ExitCode_VoidMainAppReturnsSetValue(int mode) { int expectedExitCode = 123; const string AppName = "VoidMainWithExitCodeApp.exe"; - var psi = new ProcessStartInfo(); - psi.FileName = RemoteExecutor.HostRunner; - psi.Arguments = $"{AppName} {expectedExitCode} {mode}"; - using (Process p = Process.Start(psi)) + using (Process p = Process.Start(RemoteExecutor.HostRunner, new[] { AppName, expectedExitCode.ToString(), mode.ToString() })) { p.WaitForExit(); Assert.Equal(expectedExitCode, p.ExitCode); diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs index 55f518fc24e179..9b12a1e75550ef 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs @@ -181,14 +181,12 @@ await provider.StartBrowserAndProxyAsync(context, Logger.LogTrace($"Doing the nodejs: {options.NodeApp}"); var nodeFullPath = Path.GetFullPath(options.NodeApp); Logger.LogTrace(nodeFullPath); - var psi = new ProcessStartInfo(); - - psi.UseShellExecute = false; - psi.RedirectStandardError = true; - psi.RedirectStandardOutput = true; - - psi.Arguments = $"--inspect-brk=localhost:0 {nodeFullPath}"; - psi.FileName = "node"; + var psi = new ProcessStartInfo("node", new[] { "--inspect-brk=localhost:0", nodeFullPath }) + { + UseShellExecute = false, + RedirectStandardError = true, + RedirectStandardOutput = true + }; app.UseRouter(router => { diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.cs b/src/tests/Loader/binding/tracing/BinderTracingTest.cs index 697a830b69f5df..a48e3ab419dde4 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.cs +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.cs @@ -190,10 +190,8 @@ private static bool RunSingleTest(MethodInfo method) private static bool RunTestInSeparateProcess(MethodInfo method) { - var startInfo = new ProcessStartInfo() + var startInfo = new ProcessStartInfo(Process.GetCurrentProcess().MainModule.FileName, new[] { Assembly.GetExecutingAssembly().Location, method.Name }) { - FileName = Process.GetCurrentProcess().MainModule.FileName, - Arguments = $"{Assembly.GetExecutingAssembly().Location} {method.Name}", UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true From 1b5e49444af165d950cfa9680c377023e1d8b34e Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Thu, 18 May 2023 07:01:59 -0700 Subject: [PATCH 7/9] Throw ArgumentNullException --- .../src/System/Diagnostics/Process.cs | 3 --- .../src/System/Diagnostics/ProcessStartInfo.cs | 9 ++++----- .../tests/ProcessStartInfoTests.cs | 7 +++++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs index 02ba07db85e29b..ca030f0bb12482 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.cs @@ -1327,9 +1327,6 @@ public static Process Start(string fileName, string arguments) [SupportedOSPlatform("maccatalyst")] public static Process Start(string fileName, IEnumerable arguments) { - ArgumentNullException.ThrowIfNull(fileName); - ArgumentNullException.ThrowIfNull(arguments); - return Start(new ProcessStartInfo(fileName, arguments))!; } diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs index 1e0379894a3035..888c4cec0de629 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartInfo.cs @@ -61,12 +61,11 @@ public ProcessStartInfo(string fileName, string arguments) /// public ProcessStartInfo(string fileName, IEnumerable arguments) { - _fileName = fileName; + ArgumentNullException.ThrowIfNull(fileName); + ArgumentNullException.ThrowIfNull(arguments); - if(arguments != null) - { - _argumentList = new Collection(new List(arguments)); - } + _fileName = fileName; + _argumentList = new Collection(new List(arguments)); } /// diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index 1ccdd039e4d7ef..088f7357898930 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -1279,6 +1279,13 @@ public void InitializeWithArgumentList_Enumerable() Assert.Equal(args, psi.ArgumentList); } + [Fact] + public void InitializeWithArgumentList_ThrowsArgumentNullException() + { + Assert.Throws("fileName", () => new ProcessStartInfo(null, new[] { "a", "b" })); + Assert.Throws("arguments", () => new ProcessStartInfo("a", (IEnumerable)null)); + } + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // No Notepad on Nano [MemberData(nameof(UseShellExecute))] [OuterLoop("Launches notepad")] From 2e0a9a09130b5e26fad678e6484efdf9d144bbc5 Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Thu, 18 May 2023 07:02:59 -0700 Subject: [PATCH 8/9] Modify SuperFileCheck to use new ProcessStartInfo ctor --- src/coreclr/tools/SuperFileCheck/Program.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/coreclr/tools/SuperFileCheck/Program.cs b/src/coreclr/tools/SuperFileCheck/Program.cs index cb3732b06c8fe8..cb836a657ff830 100644 --- a/src/coreclr/tools/SuperFileCheck/Program.cs +++ b/src/coreclr/tools/SuperFileCheck/Program.cs @@ -100,13 +100,13 @@ static void VerifyCheckPrefixes(string str, string[] checkPrefixes) /// static async Task RunLLVMFileCheckAsync(string[] args) { - var startInfo = new ProcessStartInfo(); - startInfo.FileName = FileCheckPath; - startInfo.Arguments = String.Join(' ', args); - startInfo.CreateNoWindow = true; - startInfo.WindowStyle = ProcessWindowStyle.Hidden; - startInfo.RedirectStandardOutput = true; - startInfo.RedirectStandardError = true; + var startInfo = new ProcessStartInfo(FileCheckPath, args) + { + CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden, + RedirectStandardOutput = true, + RedirectStandardError = true + }; try { From 356bd75a3b104bb665925cbc14e02f9e51756872 Mon Sep 17 00:00:00 2001 From: Blake Hensley Date: Fri, 19 May 2023 05:18:16 -0700 Subject: [PATCH 9/9] - Revert calls to new overload. - Fix whitespace --- src/coreclr/tools/SuperFileCheck/Program.cs | 14 +++++++------- .../tests/ProcessStartInfoTests.cs | 2 +- .../DebuggerTestSuite/TestHarnessStartup.cs | 14 ++++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/coreclr/tools/SuperFileCheck/Program.cs b/src/coreclr/tools/SuperFileCheck/Program.cs index cb836a657ff830..cb3732b06c8fe8 100644 --- a/src/coreclr/tools/SuperFileCheck/Program.cs +++ b/src/coreclr/tools/SuperFileCheck/Program.cs @@ -100,13 +100,13 @@ static void VerifyCheckPrefixes(string str, string[] checkPrefixes) /// static async Task RunLLVMFileCheckAsync(string[] args) { - var startInfo = new ProcessStartInfo(FileCheckPath, args) - { - CreateNoWindow = true, - WindowStyle = ProcessWindowStyle.Hidden, - RedirectStandardOutput = true, - RedirectStandardError = true - }; + var startInfo = new ProcessStartInfo(); + startInfo.FileName = FileCheckPath; + startInfo.Arguments = String.Join(' ', args); + startInfo.CreateNoWindow = true; + startInfo.WindowStyle = ProcessWindowStyle.Hidden; + startInfo.RedirectStandardOutput = true; + startInfo.RedirectStandardError = true; try { diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs index 088f7357898930..2370d07afbfbfb 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs @@ -1258,7 +1258,7 @@ public void UninitializedArgumentList() [Fact] public void InitializeWithArgumentList_Add() - { + { ProcessStartInfo psi = new ProcessStartInfo("filename"); string[] args = new[] { "arg1", "arg2", " arg3", "arg4 ", "arg 5", $"arg{Environment.NewLine}6" }; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs index 9b12a1e75550ef..55f518fc24e179 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs @@ -181,12 +181,14 @@ await provider.StartBrowserAndProxyAsync(context, Logger.LogTrace($"Doing the nodejs: {options.NodeApp}"); var nodeFullPath = Path.GetFullPath(options.NodeApp); Logger.LogTrace(nodeFullPath); - var psi = new ProcessStartInfo("node", new[] { "--inspect-brk=localhost:0", nodeFullPath }) - { - UseShellExecute = false, - RedirectStandardError = true, - RedirectStandardOutput = true - }; + var psi = new ProcessStartInfo(); + + psi.UseShellExecute = false; + psi.RedirectStandardError = true; + psi.RedirectStandardOutput = true; + + psi.Arguments = $"--inspect-brk=localhost:0 {nodeFullPath}"; + psi.FileName = "node"; app.UseRouter(router => {