Background and motivation
The new Process.Run() and related methods take an IList<string> for command arguments.
It should use IEnumerable<string> instead for correctness, and to be in line with the Process.Start() counterpart.
API Proposal
// Existing API
public class Process
{
public static ProcessExitStatus Run(string fileName, IList<string>? arguments = null, TimeSpan? timeout = default);
}
// Proposed API
public class Process
{
public static ProcessExitStatus Run(string fileName, IEnumerable<string>? arguments = null, TimeSpan? timeout = default);
}
// And similar for related APIs (eg. RunAndCaptureText, RunAsync, etc).
API Usage
No change for existing callers.
Alternative Designs
IReadOnlyList<string> is also a valid option.
But IEnumerable<string> will allow it to be dropped in as a replacement for more existing code, and I can see neither Count nor the indexer are used in the current implementation.
Risks
This is a breaking change. But I don't think it's beyond what's expected in Preview/RC.
Background and motivation
The new
Process.Run()and related methods take anIList<string>for command arguments.It should use
IEnumerable<string>instead for correctness, and to be in line with theProcess.Start()counterpart.API Proposal
API Usage
No change for existing callers.
Alternative Designs
IReadOnlyList<string>is also a valid option.But
IEnumerable<string>will allow it to be dropped in as a replacement for more existing code, and I can see neitherCountnor the indexer are used in the current implementation.Risks
This is a breaking change. But I don't think it's beyond what's expected in Preview/RC.