Add ProcessStartOptions class with platform-aware path resolution#124271
Merged
adamsitnik merged 36 commits intomainfrom Feb 18, 2026
Merged
Add ProcessStartOptions class with platform-aware path resolution#124271adamsitnik merged 36 commits intomainfrom
adamsitnik merged 36 commits intomainfrom
Conversation
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add ProcessStartOptions class to System.Diagnostics namespace
Add ProcessStartOptions class with platform-aware path resolution
Feb 11, 2026
adamsitnik
reviewed
Feb 11, 2026
Member
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot please address my feedback
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.cs
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Unix.cs
Show resolved
Hide resolved
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
adamsitnik
reviewed
Feb 11, 2026
Member
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot address my feedback
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
adamsitnik
reviewed
Feb 11, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
adamsitnik
reviewed
Feb 11, 2026
Member
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot please address my feedback
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/tests/ProcessStartOptionsTests.Windows.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessStartOptions.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Unix.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Copilot
AI
force-pushed
the
copilot/add-processstartoptions-class
branch
from
February 17, 2026 19:58
bc6543b to
c056741
Compare
Copilot
AI
changed the title
Add ProcessStartOptions class with simplified path resolution
Add ProcessStartOptions class with platform-aware path resolution
Feb 17, 2026
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Windows.cs
Outdated
Show resolved
Hide resolved
jkotas
reviewed
Feb 17, 2026
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Windows.cs
Outdated
Show resolved
Hide resolved
adamsitnik
reviewed
Feb 17, 2026
Member
adamsitnik
left a comment
There was a problem hiding this comment.
@copilot address my feedback
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Windows.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessUtils.Unix.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
Member
|
@copilot Address all feedback that was not addressed yet |
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
…mment Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
This was referenced Feb 18, 2026
Member
|
/ba-g all build and test failures are known |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
ProcessStartOptionsclass providing explicit path resolution and process configuration with platform-specific semantics.Changes
API Surface
ProcessStartOptions(string fileName)- resolves executable path and validates existenceFileName,Arguments,Environment,WorkingDirectory,InheritedHandles,KillOnParentExit,CreateNewProcessGroupArguments,Environment,InheritedHandlesuse lazy allocationEnvironmentpopulated fromEnvironment.GetEnvironmentVariables()usingDictionary<string, string?>ArgumentsandInheritedHandlessettersFileNotFoundExceptionwith localized message when path cannot be resolved or file doesn't existPath Resolution
.exe(except when path contains separators, ends with., or has extension) → System32 → PATH (using;separator):separator)./(Unix) or.\(Windows) prefixPath.GetFullPathfor non-fully-qualified inputsImplementation Structure
ProcessUtilspartial class consolidates shared logic:ProcessUtils.cs- sharedFindProgramInPathwith comment explaining Unix permission checkingProcessUtils.Windows.cs- privateIsExecutable(forwards toFile.Exists)ProcessUtils.Unix.cs- privateIsExecutable(validates executable permissions)Process.Unix.cscallsProcessStartOptions.ResolvePath(eliminates duplicateProcess.ResolvePath)Process.IsExecutablemade internal for reuseEnvironment.SystemDirectoryinstead of duplicatingGetSystemDirectoryWs_cachedWindowsDirectorySR.FileNotFoundResolvePathTests
new()syntax,[Theory]with[InlineData]for parameterized testsEndsWithfor paths (handles symlink variations),Path.GetFullPathfor macOS/tmpsymlinksIsNotWindowsNanoServer,IsNotWindowsServerCoreCustomer Impact
Provides safer, more explicit alternative to
ProcessStartInfofor scenarios requiring validated executable paths and controlled environment inheritance.Testing
Example
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.