You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Starting new Process as not child of the application #104210
I'd expect the child process to be reparented to PID 1 (init) and continue running.
How do you start your C# app? If you start it from a terminal emulator and close the window, then that could cause a SIGHUP to be sent to the processes using that tty, including the child process of your app. Or do you start the app from cron?
I tested when starting from Rider IDE, and stopped the app in 3 ways:
Rider stop button
Let the app exit without doing any await on the Process
Sending SIGKILL from htop
And all of these resulted in the new Process closing
In my use case, the started "child" process must survive any way the c# app might close/crash
I don't believe UseShellExecute is intended to prevent the new process from being a child of the calling process. Rather, it is a way to start things that are not executable files, such as document files and URLs.
Activity
KalleOlaviNiemitalo commentedon Jul 1, 2024
What terminates it?
dpeter99 commentedon Jul 2, 2024
The operating system.
KalleOlaviNiemitalo commentedon Jul 2, 2024
I'd expect the child process to be reparented to PID 1 (init) and continue running.
How do you start your C# app? If you start it from a terminal emulator and close the window, then that could cause a SIGHUP to be sent to the processes using that tty, including the child process of your app. Or do you start the app from cron?
dpeter99 commentedon Jul 2, 2024
I tested when starting from Rider IDE, and stopped the app in 3 ways:
And all of these resulted in the new Process closing
In my use case, the started "child" process must survive any way the c# app might close/crash
adamsitnik commentedon Jul 16, 2024
@dpeter99 thank you for your proposal. For now I'll wait until more customers express the need for such API.
dpeter99 commentedon Jul 19, 2024
@adamsitnik
What about fixing the UseShellExecute, or do you have any suggestions on how to do it?
KalleOlaviNiemitalo commentedon Jul 19, 2024
I don't believe UseShellExecute is intended to prevent the new process from being a child of the calling process. Rather, it is a way to start things that are not executable files, such as document files and URLs.
adamsitnik commentedon Jan 5, 2026
As @KalleOlaviNiemitalo wrote, I would expect that app to keep running.
@dpeter99 what exactly do you want to achieve?
nohupseems to be used to keep running the app after user logoff or closing the terminal.adamsitnik commentedon Feb 12, 2026
Please check #124334 for updates