title: How do i detach an exe from Process.Start
body: <p>In a CodedUI Test, I am using <code>System.Diagnostics.Process</code> (<code>Process.Start(exePath);</code>) to execute a .exe file.  Now my problem is, after Executing the test my application closes(WPF front-end).  My question is, How will I get the process that I just started to independent from the thread where <code>Process.Start()</code> is executing so that once I the Test has ran the exe keeps running.  I want it to keep running because there are other UI Tests that need the Front end Running. (Starting the exe at the beginning of each tests is too expensive and slow)
  I hope this is clear enough.</p>
  
  <p>This is my code:</p>
  
  <pre><code>//[TestInitialize()] has already started the exe, so I have my front end open.
  
  
  
      [TestMethod]
          [TestCategory("Default Layout")]
          static void Move_StartTimer_Button_To_The_Top_Right_Corner_Keeps_Keeps_Button_Even_After_App_Restarts()
          {
              Process myExe = Process.GetProcesses().FirstOrDefault(process =&gt; process.ProcessName == "MyAppName");
              var fileName = myExe?.MainModule.FileName;
              UIMap.Click_Close_Application();
              Assert.IsTrue(Application_Closed_Sucessfully);
              Process.Start(fileName);
  Assert.IsTrue(Application_Layout_Has_Button_On_The_Top_Right_Corner);
          }
  </code></pre>
  
  <p>When <code>Move_StartTimer_Button_To_The_Top_Right_Corner_Keeps_Keeps_Button_Even_After_App_Restarts()</code> has executed and completed, my app closes as well. How do I keep the front end running even after the execution? PLEASE NOTE: This is a CodedUI Test code, so by "after execution" I mean after the Test has ran (it may pass or fail it doesn't matter as long as it does not close the front end).</p>