Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You don't need to run it as a separate thread. </p> <p>When you use <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx" rel="nofollow noreferrer">Process.Start</a> to launch a process, it is a child process of the current application.</p> <p>Just watch for the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx" rel="nofollow noreferrer">Process.Exited</a> event (making sure to set <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.process.enableraisingevents.aspx" rel="nofollow noreferrer">EnableRaisingEvents</a> to true), and use it to see when the process exits. You can then restart the process automatically at that point.</p> <hr> <blockquote> <p>My theory on how to do this is to create an interface, called ITestBed for example and have the main class in my application implement this. The implementation will contain one method, TestApp(), for example. All I need to do from my test bed application is call this method and this method on the application side can just mirror the constructor of my current object? Will this work?</p> </blockquote> <p>This will work. You can load the main exe's assembly via reflection, and construct the main object, then call your method. Doing this makes the process part of your current application, however - so it has some side effects. You're sharing process memory space in this situation.</p> <p>If you do this, you may want to look into Application Domains. By loading and "launching" your ITestBed implementation in a separate AppDomain, you'll protect your main application.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload