Add ProcessStartOptions class with platform-aware path resolution#124271
Merged
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
adamsitnik
left a comment
Member
There was a problem hiding this comment.
@copilot please address my feedback
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
adamsitnik
reviewed
Feb 11, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
@copilot address my feedback
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
adamsitnik
reviewed
Feb 11, 2026
adamsitnik
reviewed
Feb 11, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
@copilot please address my feedback
Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
jkotas
reviewed
Feb 17, 2026
jkotas
reviewed
Feb 17, 2026
… that is used by both old and new APIs
jkotas
reviewed
Feb 17, 2026
jkotas
reviewed
Feb 17, 2026
jkotas
reviewed
Feb 17, 2026
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
jkotas
reviewed
Feb 17, 2026
jkotas
reviewed
Feb 17, 2026
adamsitnik
reviewed
Feb 17, 2026
adamsitnik
left a comment
Member
There was a problem hiding this comment.
@copilot address my feedback
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.