Skip to content

Commit 50702e9

Browse files
CopilotIEvangelist
andauthored
Fix AddExecutable compilation errors and improve API demonstration in 9.5 release post (#4989)
* Initial plan * Fix AddExecutable compilation errors in 9.5 release post Co-authored-by: IEvangelist <[email protected]> * Update examples to better demonstrate mutable WithCommand/WithWorkingDirectory APIs Co-authored-by: IEvangelist <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: IEvangelist <[email protected]>
1 parent e7b8f3e commit 50702e9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/whats-new/dotnet-aspire-9.5.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -914,17 +914,16 @@ Enhanced APIs for configuring executable resources with command and working dire
914914
915915
#### WithCommand and WithWorkingDirectory APIs
916916
917-
New extension methods allow precise control over executable resource execution:
917+
New extension methods enable fluent, mutable configuration of executable resources, allowing you to modify command and working directory after initial setup:
918918
919919
```csharp
920920
// Configure executable with custom command and working directory
921-
var processor = builder.AddExecutable("data-processor", "python")
921+
var processor = builder.AddExecutable("data-processor", "python", "/app/data-processing")
922922
.WithCommand("main.py --batch-size 100")
923-
.WithWorkingDirectory("/app/data-processing")
924923
.WithArgs("--config", "production.json");
925924
926-
// Executable with specific working directory for relative paths
927-
var buildTool = builder.AddExecutable("build-tool", "npm")
925+
// Change working directory after initial configuration
926+
var buildTool = builder.AddExecutable("build-tool", "npm", ".")
928927
.WithCommand("run build:production")
929928
.WithWorkingDirectory("./frontend");
930929
```
@@ -934,7 +933,7 @@ var buildTool = builder.AddExecutable("build-tool", "npm")
934933
The `CommandLineArgsCallbackContext` now includes resource information for context-aware argument building:
935934
936935
```csharp
937-
var worker = builder.AddExecutable("worker", "dotnet")
936+
var worker = builder.AddExecutable("worker", "dotnet", ".")
938937
.WithArgs(context =>
939938
{
940939
// Access to the resource instance for dynamic configuration

0 commit comments

Comments
 (0)