ProjectLaunchArgsOverrideAnnotation
ProjectResource. namespace Aspire.Hosting.ApplicationModel;
public sealed class ProjectLaunchArgsOverrideAnnotation : Aspire.Hosting.ApplicationModel.IResourceAnnotation{ // ...}Remarks
Section titled Remarks When this annotation is present on a ProjectResource, DCP will use the provided arguments as the base command (e.g., build /t:Run) instead of the default run verb. DCP still appends the project path positionally and appends --configuration automatically; only the verb and its options are overridden. This annotation is intended for verbs like build that accept the project path as a positional argument. The --no-launch-profile flag is omitted when this annotation is present.
A non-empty launch-tool argument callback replaces this base command. If the callback resolves no arguments, this override remains the Process command.
Constructors1
Section titled ConstructorsProjectLaunchArgsOverrideAnnotation(IReadOnlyList<string>, string?)ProjectResource. Properties2
Section titled PropertiesArgumentsgetIReadOnlyList<string>LeadingResourceArgumentToRemovegetstring?ProjectLaunchArgsOverrideAnnotation.Arguments. Examples
Section titled ExamplesOverride DCP's default launch to use dotnet build /t:Run:
builder.WithAnnotation(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"]));