title: How to keep c# process alive (Node server)
body: <p>Hello i'am creating a process in c# that opens a node.js, so far so good but the process seems to end and tipically when i execute the same command from my cmd it stays alive, how can i achieve such thing from c#? Here is the code of the Process</p>
  
  <pre><code>     private void buttonStartLLodiAgent_Click(object sender, EventArgs e)
      {
  
          //proc.WaitForExit();
          ProcessStartInfo psi = new ProcessStartInfo();
          psi.CreateNoWindow = true;
          psi.RedirectStandardInput = true;
          psi.RedirectStandardOutput = true;
          psi.UseShellExecute = false;
          psi.RedirectStandardError = true;
          psi.FileName = "node.exe";
          psi.Arguments = AppDomain.CurrentDomain.BaseDirectory + "/LLodiAgent/main.js";
          using (var process = Process.Start(psi))
          {
              //labelStatusLLodiAgent.Text = "Active";
              process.BeginOutputReadLine();
              process.OutputDataReceived += proc_OutputDataReceived;
              //process.WaitForExit();
          }
  
      }
      public void proc_OutputDataReceived(object sender, DataReceivedEventArgs e)
      {
          outputConsole.Text = outputConsole.Text + "\r\n" + e.Data;
      }
  </code></pre>
  
  <p>I get my Output right, but it seems like the Node service is not up, so i guess it executes but then kills it. 
  How to keep the server alive and the c# recieving data?</p>
  
  <p>Thanks in advance, (this is my first post)   </p>