dotnet/reactive · error · InvalidOperationException

Did not get output from program

Error message

Did not get output from program

What it means

After launching the plug-in host process, PlugInHost.Run waits in a loop (with Task.WhenAny against Task.Delay(2000)) for the process's output task to complete. If output never completes, it throws InvalidOperationException('Did not get output from program'). This means the child process hung, crashed without closing stdout, or never produced its completion output within the polling loop's patience.

Solutions

  1. Reproduce and run the PlugIn.Host exe manually with the same arguments to see why it produces no output
  2. Check the plug-in DLLs for load-time deadlocks or blocking static initializers
  3. Increase the polling timeout if the process is legitimately slow
  4. Verify the host process is not waiting on stdin or a missing file at startup
Defensive patterns

Strategy: try-catch

Validate before calling

using var p = Process.Start(startInfo);
// ensure the exe starts before relying on output
if (p is null || p.HasExited) throw new InvalidOperationException("Host process failed to start");

Type guard

bool CompletedWithin(Task t, int ms) => Task.WaitAny(new[]{t}, ms) != -1;

Try / catch

try
{
    var result = await plugInHost.Run(...);
}
catch (InvalidOperationException ex) when (ex.Message == "Did not get output from program")
{
    // kill hung child process, capture dump/logs, mark scenario failed
}

Prevention

When it happens

Trigger: The spawned PlugIn.Host process fails to write its expected output to stdout/stderr before the polling loop gives up; the process hangs indefinitely or is blocked waiting for input.

Common situations: A plug-in deadlocks at load; the host exe crashes early so no output ever arrives; console redirection issues; extremely slow first-run ( NuGet restore, JIT ) exceeding the wait loop.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of dotnet/reactive@94b5d5ab91 (2026-09-15). Data as JSON: /api/errors/9ef45e6c1822b852. Report an issue: GitHub.

Appendix: source

Thrown at Rx.NET/Test/Gauntlet/Checks/PlugIns/PlugIn.HostDriver/PlugInHost.cs:155

        var resultTask = stdOutStreamToResult(process.StandardOutput.BaseStream);
        var processTask = process.WaitForExitAsync();
        var firstToFinish = await Task.WhenAny(processTask, resultTask);

        if (process.HasExited && process.ExitCode != 0)
        {
            Console.WriteLine($"{plugInHostExecutablePath} exited with code {process.ExitCode} for args {startInfo.Arguments}");
        }

        if (!resultTask.IsCompleted)
        {
            // The process finished, but the result task is still running. It's possible that
            // it is nearly done, so give it some time.
            await Task.WhenAny(resultTask, Task.Delay(2000));
        }

        if (!resultTask.IsCompleted)
        {
            throw new InvalidOperationException("Did not get output from program");
        }
        var result = await resultTask;

        return result;
    }
}

View on GitHub (pinned to 94b5d5ab91)