ToolchainEnvironment.CaptureOutputAsync
Section titled “ToolchainEnvironment.CaptureOutputAsync”
- Captures a tool’s standard output while forwarding errors and preserving the common process lifecycle.
Required contracts
Section titled “Required contracts”API: engine
Project: Inno.Build.Toolchains
Declaration
Section titled “Declaration”public static System.Threading.Tasks.Task<string> Inno.Build.Toolchains.ToolchainEnvironment.CaptureOutputAsync(string fileName, System.Collections.Generic.IReadOnlyList<string> arguments, string workingDirectory, System.Threading.CancellationToken cancellationToken, System.Collections.Generic.IReadOnlyDictionary<string, string?>? environment = null)Parameters
Section titled “Parameters”Parameter fileName: The executable to launch.
Parameter arguments: Structured arguments passed without shell interpretation.
Parameter workingDirectory: The directory used for project and SDK resolution.
Parameter cancellationToken: Cancels the child process tree and waits for its complete exit.
Parameter environment: Optional child-only environment variables. Null values remove inherited variables; empty values remain explicitly empty.
Returns
Section titled “Returns”The complete standard output after successful exit. Unsuccessful exits retain captured output in the exception.
Exceptions
Section titled “Exceptions”Exception T:System.InvalidOperationException: The tool fails to start or exits unsuccessfully.
Exception T:System.OperationCanceledException: The operation was canceled.
Exception T:System.IO.IOException: Redirected output cannot be read or forwarded; the process tree is terminated before failure returns.