# ProjectLaunchArgsOverrideAnnotation

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.5.3`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/b5f143315ffb6968ea939a9978797a5b20e4c688/src/Aspire.Hosting/ApplicationModel/ProjectLaunchArgsOverrideAnnotation.cs)
- Implements: [IResourceAnnotation](/reference/api/csharp/aspire.hosting/iresourceannotation.md)

Represents an annotation that overrides the default project launch arguments generated by DCP for a [ProjectResource](/reference/api/csharp/aspire.hosting/projectresource.md).

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public sealed class ProjectLaunchArgsOverrideAnnotation
    : Aspire.Hosting.ApplicationModel.IResourceAnnotation
{
    // ...
}
```

## Remarks

When this annotation is present on a [ProjectResource](/reference/api/csharp/aspire.hosting/projectresource.md), 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.

## Constructors

- [ProjectLaunchArgsOverrideAnnotation(IReadOnlyList<string>, string?)](/reference/api/csharp/aspire.hosting/projectlaunchargsoverrideannotation/constructors.md#constructor-ireadonlylist-string-string) -- Represents an annotation that overrides the default project launch arguments generated by DCP for a [ProjectResource](/reference/api/csharp/aspire.hosting/projectresource.md).

## Properties

- [Arguments](/reference/api/csharp/aspire.hosting/projectlaunchargsoverrideannotation/properties.md#arguments) : `IReadOnlyList<string>` `get` -- Gets the custom launch arguments to use instead of the default project args.
- [LeadingResourceArgumentToRemove](/reference/api/csharp/aspire.hosting/projectlaunchargsoverrideannotation/properties.md#leadingresourceargumenttoremove) : `string?` `get` -- Gets the optional first resource argument to omit from the final launch arguments when it is already represented by [ProjectLaunchArgsOverrideAnnotation.Arguments](/reference/api/csharp/aspire.hosting/projectlaunchargsoverrideannotation/properties.md#arguments).

## Examples

Override DCP's default launch to use dotnet build /t:Run:

```csharp
builder.WithAnnotation(new ProjectLaunchArgsOverrideAnnotation(["build", "/t:Run"]));
```
