Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/winapp-CLI/WinApp.Cli/Services/DotNetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,8 @@ private static async Task<int> RunDotnetCoreAsync(
throw;
}

// WaitForExitAsync returns once the process exits, but the async stdout/stderr readers may
// still have buffered data in flight. The parameterless overload blocks until those readers
// have flushed, so the StringBuilders are complete before we read them.
// On .NET 10, WaitForExitAsync already drains both asynchronous readers and completes their
// callbacks. The synchronous wait below is redundant for output delivery.
process.WaitForExit();

return (process.ExitCode, outputBuilder.ToString(), errorBuilder.ToString());
Expand Down
10 changes: 10 additions & 0 deletions src/winapp-CLI/WinApp.Cli/Services/IDotNetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ internal interface IDotNetService
/// supports one.
/// </para>
/// </summary>
/// <remarks>
/// On normal completion (including a nonzero exit code), both output readers and their callbacks
/// have finished. Cancellation can interrupt output delivery; asynchronous work queued by
/// callbacks is not awaited.
/// </remarks>
/// <param name="environmentOverrides">
/// Optional environment variables to set on the child process (merged over the inherited
/// environment). Use this to force locale-independent output, e.g. <c>DOTNET_CLI_UI_LANGUAGE=en</c>,
Expand Down Expand Up @@ -111,6 +116,11 @@ internal interface IDotNetService
/// The callbacks are invoked on background threads; callers that touch shared state must
/// synchronize. The command's own output is NOT written anywhere unless a callback does so.
/// </summary>
/// <remarks>
/// On normal completion (including a nonzero exit code), both output readers and their callbacks
/// have finished. Cancellation can interrupt output delivery; asynchronous work queued by
/// callbacks is not awaited.
/// </remarks>
Task<int> RunDotnetStreamingAsync(
DirectoryInfo workingDirectory,
string arguments,
Expand Down
Loading