diff --git a/src/winapp-CLI/WinApp.Cli/Services/DotNetService.cs b/src/winapp-CLI/WinApp.Cli/Services/DotNetService.cs index ad81fcbdd..a68956c9f 100644 --- a/src/winapp-CLI/WinApp.Cli/Services/DotNetService.cs +++ b/src/winapp-CLI/WinApp.Cli/Services/DotNetService.cs @@ -619,9 +619,8 @@ private static async Task 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()); diff --git a/src/winapp-CLI/WinApp.Cli/Services/IDotNetService.cs b/src/winapp-CLI/WinApp.Cli/Services/IDotNetService.cs index ff425a4f6..f972cc961 100644 --- a/src/winapp-CLI/WinApp.Cli/Services/IDotNetService.cs +++ b/src/winapp-CLI/WinApp.Cli/Services/IDotNetService.cs @@ -83,6 +83,11 @@ internal interface IDotNetService /// supports one. /// /// + /// + /// 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. + /// /// /// Optional environment variables to set on the child process (merged over the inherited /// environment). Use this to force locale-independent output, e.g. DOTNET_CLI_UI_LANGUAGE=en, @@ -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. /// + /// + /// 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. + /// Task RunDotnetStreamingAsync( DirectoryInfo workingDirectory, string arguments,