You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/whats-new/dotnet-aspire-9.5.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -914,17 +914,16 @@ Enhanced APIs for configuring executable resources with command and working dire
914
914
915
915
#### WithCommand and WithWorkingDirectory APIs
916
916
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:
918
918
919
919
```csharp
920
920
// 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")
922
922
.WithCommand("main.py --batch-size 100")
923
-
.WithWorkingDirectory("/app/data-processing")
924
923
.WithArgs("--config", "production.json");
925
924
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", ".")
928
927
.WithCommand("run build:production")
929
928
.WithWorkingDirectory("./frontend");
930
929
```
@@ -934,7 +933,7 @@ var buildTool = builder.AddExecutable("build-tool", "npm")
934
933
The `CommandLineArgsCallbackContext` now includes resource information for context-aware argument building:
935
934
936
935
```csharp
937
-
var worker = builder.AddExecutable("worker", "dotnet")
936
+
var worker = builder.AddExecutable("worker", "dotnet", ".")
938
937
.WithArgs(context =>
939
938
{
940
939
// Access to the resource instance for dynamic configuration
0 commit comments