Skip to content

Support for output redirects with startFuncProcess #4745

@mattchenderson

Description

@mattchenderson

For Aspire scenarios, C# Dev Kit makes use of the startFuncProcess export:

/**
* Starts a new function process and returns the process id of the new process. This is for .NET projects only.
*
* @param {string} buildPath - The fully qualified path to the project's build output.
* @param {string[]} args - A list of command-line arguments to pass to the process.
* @param {{ [key: string]: string }} env - A map of key-value pairs representing environment variables to pass to the process.
*
* @returns {Promise<{ processId: string; success: boolean; error: string }>} -
* - `processId` {string}: The ID of the started process.
* - `success` {boolean}: Whether the process started successfully.
* - `error` {string}: Error message in case the process fails to start, otherwise an empty string.
*/
startFuncProcess(buildPath: string, args: string[], env: { [key: string]: string }): Promise<{ processId: string; success: boolean; error: string }>;

Today, this means that log streaming in the Aspire Dashboard is lost, because stdout and stderr are just sent to the VSC output terminal. C# Dev Kit isn't launching the process and therefore can't redirect. See microsoft/vscode-dotnettools#1598

We'd like for there to be some way for C# Dev Kit to optionally redirect stdout/stderr through startFuncProcess. Validation requires working with Dev Kit to ensure they can consume it once available, and we'll aim to validate end-to-end within the context of Aspire.

CC @satvu @fabiocav @WardenGnaw @gregg-miskelly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions