From bb5ec1b8db8c96c32459dfcfbdb5105d1832d8d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:47:59 +0000 Subject: [PATCH 1/3] Initial plan From 1351c27dc8784d63a0b9a6e60958003183182e0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Oct 2025 12:56:45 +0000 Subject: [PATCH 2/3] Fix AddExecutable compilation errors in 9.5 release post Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- docs/whats-new/dotnet-aspire-9.5.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/whats-new/dotnet-aspire-9.5.md b/docs/whats-new/dotnet-aspire-9.5.md index 716bd96bf9..c846e2b4bd 100644 --- a/docs/whats-new/dotnet-aspire-9.5.md +++ b/docs/whats-new/dotnet-aspire-9.5.md @@ -918,13 +918,13 @@ New extension methods allow precise control over executable resource execution: ```csharp // Configure executable with custom command and working directory -var processor = builder.AddExecutable("data-processor", "python") +var processor = builder.AddExecutable("data-processor", "python", ".") .WithCommand("main.py --batch-size 100") .WithWorkingDirectory("/app/data-processing") .WithArgs("--config", "production.json"); // Executable with specific working directory for relative paths -var buildTool = builder.AddExecutable("build-tool", "npm") +var buildTool = builder.AddExecutable("build-tool", "npm", ".") .WithCommand("run build:production") .WithWorkingDirectory("./frontend"); ``` @@ -934,7 +934,7 @@ var buildTool = builder.AddExecutable("build-tool", "npm") The `CommandLineArgsCallbackContext` now includes resource information for context-aware argument building: ```csharp -var worker = builder.AddExecutable("worker", "dotnet") +var worker = builder.AddExecutable("worker", "dotnet", ".") .WithArgs(context => { // Access to the resource instance for dynamic configuration From fdb03dd2449b6011edafe4bf148850c1989c7abb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Oct 2025 23:10:08 +0000 Subject: [PATCH 3/3] Update examples to better demonstrate mutable WithCommand/WithWorkingDirectory APIs Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- docs/whats-new/dotnet-aspire-9.5.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/whats-new/dotnet-aspire-9.5.md b/docs/whats-new/dotnet-aspire-9.5.md index c846e2b4bd..4966095bc6 100644 --- a/docs/whats-new/dotnet-aspire-9.5.md +++ b/docs/whats-new/dotnet-aspire-9.5.md @@ -914,16 +914,15 @@ Enhanced APIs for configuring executable resources with command and working dire #### WithCommand and WithWorkingDirectory APIs -New extension methods allow precise control over executable resource execution: +New extension methods enable fluent, mutable configuration of executable resources, allowing you to modify command and working directory after initial setup: ```csharp // Configure executable with custom command and working directory -var processor = builder.AddExecutable("data-processor", "python", ".") +var processor = builder.AddExecutable("data-processor", "python", "/app/data-processing") .WithCommand("main.py --batch-size 100") - .WithWorkingDirectory("/app/data-processing") .WithArgs("--config", "production.json"); -// Executable with specific working directory for relative paths +// Change working directory after initial configuration var buildTool = builder.AddExecutable("build-tool", "npm", ".") .WithCommand("run build:production") .WithWorkingDirectory("./frontend");