Skip to content

Process.WaitForExit() hangs forever even after process exits, I don't have control over child processes #120452

@gcampbell-msft

Description

@gcampbell-msft

Description

This is very similar to #29232. However, specifically in this case I do not have a control over whether the process creates it's subprocesses in any certain way.

This is happening on Windows for me specifically.

In my case, I'm using very simple process.start and data output and error output handlers, similar to the docs.

Reproduction Steps

Ensure that the following is set:

processStartInfo.RedirectStandardOutput = true;
processStartInfo.RedirectStandardError = true;
processStartInfo.UseShellExecute = false;
processStartInfo.CreateNoWindow = true;

And that you have dataoutput handlers and error output handlers.

Expected behavior

No hanging on the WaitForExit.

Actual behavior

Hanging on the WaitForExit

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions