WaitForExit( 1 ) never returns

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ebbe Kristensen

    WaitForExit( 1 ) never returns

    Hi All

    I am writing a C# program that starts another program. Since this is
    destined to run on an un-attended PC, I want to be certain that my program
    can regain control. To this end, I use the WaitForExit methos with a
    timeout.

    So in order to test this, I added an endless loop to the other program such
    that it never returns. My problem is that neither does WaitForExit. Even
    WaitForExit( 1 ) never returns when the other program hangs.

    Why? And what should I do to make it work?

    Ebbe


  • Ebbe Kristensen

    #2
    Re: WaitForExit( 1 ) never returns

    Ebbe Kristensen wrote:
    Why? And what should I do to make it work?
    Never mind - it turned out that using MyProccess.Stan dardError.ReadT oEnd()
    was the culprit. Changing that to asynchroneous collection solved the
    problem.

    Ebbe


    Comment

    Working...