From 91a5601ce98d3c29cd7904846d12e5a1e373fcec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Jul 2026 15:09:21 +0000 Subject: [PATCH 1/3] Change IList to IEnumerable in Process Run/StartAndForget methods Fixes #130364 by updating the parameter type of the arguments parameter in Process.Run, Process.RunAsync, Process.RunAndCaptureText, Process.RunAndCaptureTextAsync, and Process.StartAndForget to use IEnumerable instead of IList, consistent with the existing Process.Start(string, IEnumerable) overload. Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com> --- .../ref/System.Diagnostics.Process.cs | 10 +++++----- .../src/System/Diagnostics/Process.Scenarios.cs | 14 +++++++------- 2 files changed, 12 insertions(+), 12 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 52dfab59a18f05..71e903dc30c3ec 100644 --- a/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs +++ b/src/libraries/System.Diagnostics.Process/ref/System.Diagnostics.Process.cs @@ -193,7 +193,7 @@ public void Refresh() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] - public static System.Diagnostics.ProcessExitStatus Run(string fileName, System.Collections.Generic.IList? arguments = null, bool silent = false, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; } + public static System.Diagnostics.ProcessExitStatus Run(string fileName, System.Collections.Generic.IEnumerable? arguments = null, bool silent = false, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] @@ -201,7 +201,7 @@ public void Refresh() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] - public static System.Diagnostics.ProcessTextOutput RunAndCaptureText(string fileName, System.Collections.Generic.IList? arguments = null, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; } + public static System.Diagnostics.ProcessTextOutput RunAndCaptureText(string fileName, System.Collections.Generic.IEnumerable? arguments = null, System.TimeSpan? timeout = default(System.TimeSpan?)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] @@ -209,7 +209,7 @@ public void Refresh() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] - public static System.Threading.Tasks.Task RunAndCaptureTextAsync(string fileName, System.Collections.Generic.IList? arguments = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task RunAndCaptureTextAsync(string fileName, System.Collections.Generic.IEnumerable? arguments = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] @@ -217,7 +217,7 @@ public void Refresh() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] - public static System.Threading.Tasks.Task RunAsync(string fileName, System.Collections.Generic.IList? arguments = null, bool silent = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task RunAsync(string fileName, System.Collections.Generic.IEnumerable? arguments = null, bool silent = false, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer @@ -251,7 +251,7 @@ public void Refresh() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("maccatalyst")] // this needs to come after the ios attribute due to limitations in the platform analyzer - public static int StartAndForget(string fileName, System.Collections.Generic.IList? arguments = null) { throw null; } + public static int StartAndForget(string fileName, System.Collections.Generic.IEnumerable? arguments = null) { throw null; } public override string ToString() { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs index 25bec66a903087..bde8aa3c5c8c4b 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs @@ -80,7 +80,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] - public static int StartAndForget(string fileName, IList? arguments = null) + public static int StartAndForget(string fileName, IEnumerable? arguments = null) => StartAndForget(CreateStartInfo(fileName, arguments)); /// @@ -137,7 +137,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] - public static ProcessExitStatus Run(string fileName, IList? arguments = null, bool silent = false, TimeSpan? timeout = default) + public static ProcessExitStatus Run(string fileName, IEnumerable? arguments = null, bool silent = false, TimeSpan? timeout = default) { ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments); @@ -199,7 +199,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] - public static async Task RunAsync(string fileName, IList? arguments = null, bool silent = false, CancellationToken cancellationToken = default) + public static async Task RunAsync(string fileName, IEnumerable? arguments = null, bool silent = false, CancellationToken cancellationToken = default) { ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments); @@ -289,7 +289,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] - public static ProcessTextOutput RunAndCaptureText(string fileName, IList? arguments = null, TimeSpan? timeout = default) + public static ProcessTextOutput RunAndCaptureText(string fileName, IEnumerable? arguments = null, TimeSpan? timeout = default) => RunAndCaptureText(CreateStartInfoForCapture(fileName, arguments), timeout); /// @@ -355,10 +355,10 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI [UnsupportedOSPlatform("ios")] [UnsupportedOSPlatform("tvos")] [SupportedOSPlatform("maccatalyst")] - public static Task RunAndCaptureTextAsync(string fileName, IList? arguments = null, CancellationToken cancellationToken = default) + public static Task RunAndCaptureTextAsync(string fileName, IEnumerable? arguments = null, CancellationToken cancellationToken = default) => RunAndCaptureTextAsync(CreateStartInfoForCapture(fileName, arguments), cancellationToken); - private static ProcessStartInfo CreateStartInfo(string fileName, IList? arguments) + private static ProcessStartInfo CreateStartInfo(string fileName, IEnumerable? arguments) { ArgumentException.ThrowIfNullOrEmpty(fileName); @@ -374,7 +374,7 @@ private static ProcessStartInfo CreateStartInfo(string fileName, IList? return startInfo; } - private static ProcessStartInfo CreateStartInfoForCapture(string fileName, IList? arguments) + private static ProcessStartInfo CreateStartInfoForCapture(string fileName, IEnumerable? arguments) { ProcessStartInfo startInfo = CreateStartInfo(fileName, arguments); startInfo.RedirectStandardOutput = true; From 500241278d92843c05c90c80d0acf8864200e112 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:00:26 +0000 Subject: [PATCH 2/3] Simplify CreateStartInfo to delegate to ProcessStartInfo ctor Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com> --- .../src/System/Diagnostics/Process.Scenarios.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs index bde8aa3c5c8c4b..628f028b5a27f2 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs @@ -362,16 +362,7 @@ private static ProcessStartInfo CreateStartInfo(string fileName, IEnumerable? arguments) From dd53a780ef265789564b4b1ce59b9306f8e1565a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:49:49 +0000 Subject: [PATCH 3/3] Fix target-type new and update XML docs to use 'empty sequence' Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com> --- .../src/System/Diagnostics/Process.Scenarios.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs index 628f028b5a27f2..3952c4a540400a 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Scenarios.cs @@ -61,7 +61,7 @@ public static int StartAndForget(ProcessStartInfo startInfo) /// /// The name of the application or document to start. /// - /// The command-line arguments to pass to the process. Pass or an empty list + /// The command-line arguments to pass to the process. Pass or an empty sequence /// to start the process without additional arguments. /// /// The process ID of the started process. @@ -118,7 +118,7 @@ public static ProcessExitStatus Run(ProcessStartInfo startInfo, TimeSpan? timeou /// /// The name of the application or document to start. /// - /// The command-line arguments to pass to the process. Pass or an empty list + /// The command-line arguments to pass to the process. Pass or an empty sequence /// to start the process without additional arguments. /// /// @@ -181,7 +181,7 @@ public static async Task RunAsync(ProcessStartInfo startInfo, /// /// The name of the application or document to start. /// - /// The command-line arguments to pass to the process. Pass or an empty list + /// The command-line arguments to pass to the process. Pass or an empty sequence /// to start the process without additional arguments. /// /// @@ -275,7 +275,7 @@ public static ProcessTextOutput RunAndCaptureText(ProcessStartInfo startInfo, Ti /// /// The name of the application or document to start. /// - /// The command-line arguments to pass to the process. Pass or an empty list + /// The command-line arguments to pass to the process. Pass or an empty sequence /// to start the process without additional arguments. /// /// @@ -342,7 +342,7 @@ public static async Task RunAndCaptureTextAsync(ProcessStartI /// /// The name of the application or document to start. /// - /// The command-line arguments to pass to the process. Pass or an empty list + /// The command-line arguments to pass to the process. Pass or an empty sequence /// to start the process without additional arguments. /// /// @@ -362,7 +362,7 @@ private static ProcessStartInfo CreateStartInfo(string fileName, IEnumerable? arguments)