How do I launch a process in C# on Linux where the launching process can end without killing the child process? - Stack Overflow

admin2025-04-15  0

I have a C# app that runs in Linux. It must, at some point, start another app as a separate process, and then exit itself.

Every time I try to do this, the new process dies with the old one. I've tried various settings in the ProcessStartInfo, but nothing seems to help.

Here's what I'm currently doing:

var procStartInfo = new ProcessStartInfo( program, arguments )
{
  UseShellExecute = true,
  WorkingDirectory = workingDir
};

_ = Process.Start( procStartInfo );

When I do this, both apps end when the launching app ends.

转载请注明原文地址:http://www.anycun.com/QandA/1744714767a86610.html