New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API Proposal]: ProcessStartInfo.CreateSuspended, Process.Resume #94127
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsBackground and motivationCurrently I use I now need to use the My proposal would also be cross-platform. API Proposalnamespace System.Diagnostics;
public sealed partial class ProcessStartInfo
{
public bool CreateSuspended { get; set; }
}
public partial class Process
{
public bool Resume();
} API Usagevar process = new Process()
{
StartInfo = {
FileName = executable,
CreateSuspended = true,
CreateNoWindow = true, // for reference only, as it has the same characteristics
}
};
process.Start();
// Do whatever is needed with the process...
process.Resume(); Alternative DesignsI don't think these issues are duplicates since they adopt a different design that doesn't seem to get traction. NB: @hach-que I copied your proposal and tried to make the API easier to get through the review process. RisksNo response
|
To be clear, it's not that #71515 didn't have traction. The discussion landed on exposing "proper" properties for the various flags and options related to process creation (as you've done for |
Just to add my 2 cents, this should be the last remaining feature that is needed by PowerShell to move away from custom PInvoke code to using |
Background and motivation
Currently I use
ProcessStartInfo/Process.Start
to launch processes with overridden environment variables, redirect standard input and output, and so forth.I now need to use the
CREATE_SUSPENDED
flag so that I can modify the process after it's created and before it starts actual execution, but there's no way to pass this flag intoProcessStartInfo/Process.Start
. Given that I still need to use all the other features ofProcessStartInfo
, the only reasonable path I can see forward is to either copy or reimplement the entirety of theSystem.Diagnostics.Process
code.My proposal would also be cross-platform.
API Proposal
API Usage
Alternative Designs
I don't think these issues are duplicates since they adopt a different design that doesn't seem to get traction.
#71515
#90581
NB: @hach-que I copied your proposal and tried to make the API easier to get through the review process.
Risks
No response
The text was updated successfully, but these errors were encountered: