# CommandLineArgsCallbackContext Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [CommandLineArgsCallbackContext](/reference/api/csharp/aspire.hosting/commandlineargscallbackcontext.md)
- Kind: `Properties`
- Members: `5`

Represents a callback context for the list of command-line arguments associated with an executable resource.

## Args

- Name: `Args`
- Modifiers: `get`
- Returns: `IList<object>`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs#L103)

Gets the list of command-line arguments.

```csharp
public IList<object> Args { get; }
```

## CancellationToken

- Name: `CancellationToken`
- Modifiers: `get`
- Returns: `CancellationToken`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs#L108)

Gets the cancellation token associated with the callback context.

```csharp
public CancellationToken CancellationToken { get; }
```

## ExecutionContext

- Name: `ExecutionContext`
- Modifiers: `get; init`
- Returns: [DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs)

Gets or sets the execution context for the distributed application.

```csharp
public DistributedApplicationExecutionContext ExecutionContext { get; init; }
```

## Logger

- Name: `Logger`
- Modifiers: `get; init`
- Returns: `ILogger`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs)

Gets or sets the logger for the distributed application.

```csharp
public ILogger Logger { get; init; }
```

## Resource

- Name: `Resource`
- Modifiers: `get`
- Returns: [IResource](/reference/api/csharp/aspire.hosting/iresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/CommandLineArgsCallbackAnnotation.cs#L140)

The resource associated with this callback context.

```csharp
public IResource Resource { get; }
```

## Exceptions

- `InvalidOperationException` -- Thrown when the CommandLineArgsCallbackContext was created without a specified resource.

## Remarks

This will be set to the resource in all cases where Aspire invokes the callback.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
