{"record":{"id":"0066b3622a8b4f00","repo":"dotnet/reactive","slug":"did-not-get-output-from-program-modifiedprojectclone","errorCode":null,"errorMessage":"Did not get output from program","messagePattern":"Did not get output from program","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Test/Gauntlet/RxGauntlet.Common/Build/ModifiedProjectClone.cs","lineNumber":148,"sourceCode":"            WorkingDirectory = _copyPath,\n        };\n\n        using var process = new Process { StartInfo = startInfo };\n        process.Start();\n        Task<string> stdOutTask = Task.Run(process.StandardOutput.ReadToEndAsync);\n        Task processTask = process.WaitForExitAsync();\n        Task firstToFinish = await Task.WhenAny(processTask, stdOutTask);\n\n        if (!stdOutTask.IsCompleted)\n        {\n            // The process finished, but the standard output task is still running. It's possible that\n            // it is nearly done, so give it some time.\n            await Task.WhenAny(stdOutTask, Task.Delay(2000));\n        }\n\n        if (!stdOutTask.IsCompleted)\n        {\n            throw new InvalidOperationException(\"Did not get output from program\");\n        }\n        string stdOut = await stdOutTask;\n\n        await processTask;\n        string outputFolder = Path.Combine(ClonedProjectFolderPath, \"bin\", \"Release\");\n        return new BuildOutput(process.ExitCode, outputFolder, stdOut);\n    }\n}\n","sourceCodeStart":130,"sourceCodeEnd":157,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Test/Gauntlet/RxGauntlet.Common/Build/ModifiedProjectClone.cs#L130-L157","documentation":"ModifiedProjectClone.RunDotnetCommonBuild (used by RunDotnetBuild/RunDotnetPack/RunDotnetPublish) launches dotnet and polls the stdout task with Task.WhenAny + Task.Delay(2000). If stdout never completes, it throws InvalidOperationException('Did not get output from program'), aborting the build/pack/publish of the cloned project.","triggerScenarios":"The spawned dotnet process hangs or produces no terminating stdout while the polling loop waits, leaving stdOutTask incomplete at the final check.","commonSituations":"dotnet restore hanging on a network feed; first-run SDK telemetry/first-time-experience delay; the clone folder lacks a valid project so dotnet waits or fails oddly; pipe not closed due to a spawned MSBuild node lingering.","solutions":["Run the same dotnet command manually in the clone folder to see why it hangs","Check NuGet feed connectivity / disable first-run experience (DOTNET_SKIP_FIRST_TIME_EXPERIENCE, --no-restore) if restore is the bottleneck","Increase the polling timeout for large builds","Ensure both stdout and stderr are drained concurrently to avoid pipe-buffer deadlock"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var psi = new ProcessStartInfo(\"dotnet\", args) { RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false };\nusing var p = Process.Start(psi);\nif (p is null) throw new InvalidOperationException(\"dotnet failed to start\");","typeGuard":"bool OutputCompleted(Task<string> t, int ms) => Task.WaitAny(new[]{t}, ms) != -1;","tryCatchPattern":"try\n{\n    var output = await clone.RunDotnetBuildAsync(...);\n}\ncatch (InvalidOperationException ex) when (ex.Message == \"Did not get output from program\")\n{\n    // kill dotnet/msbuild nodes, check feed connectivity, retry with longer timeout\n}","preventionTips":["Verify NuGet feed connectivity before long builds; use --no-restore when restore is unnecessary","Set DOTNET_CLI_TELEMETRY_OPTOUT=1 and skip first-run experience in CI","Drain stdout and stderr concurrently to avoid pipe deadlock","Kill the whole process tree on timeout so MSBuild nodes do not linger"],"tags":["process","timeout","dotnet","build"],"backgroundTag":"request-timeout","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}