# ExecuteCommandContext Properties

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

Context for [ResourceCommandAnnotation.ExecuteCommand](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#executecommand).

## Arguments

- Name: `Arguments`
- Modifiers: `get; init`
- Returns: [InteractionInputCollection](/reference/api/csharp/aspire.hosting/interactioninputcollection.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs)

Gets the invocation arguments supplied by the client when the command is executed.

```csharp
public InteractionInputCollection Arguments { get; init; }
```

## Remarks

The collection contains the arguments described by [ResourceCommandAnnotation.Arguments](/reference/api/csharp/aspire.hosting/resourcecommandannotation/properties.md#arguments) with their submitted values populated. CLI positional arguments are mapped by declaration order. Dashboard, MCP, and other named-payload clients are mapped by [InteractionInput.Name](/reference/api/csharp/aspire.hosting/interactioninput/properties.md#name).

## CancellationToken

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

The cancellation token.

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

## Logger

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

The logger for the resource.

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

## ResourceName

- Name: `ResourceName`
- Modifiers: `get; init`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs)

The resource name.

```csharp
public string ResourceName { get; init; }
```

## ServiceProvider

- Name: `ServiceProvider`
- Modifiers: `get; init`
- Returns: `IServiceProvider`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/a3766e994fd2cba86c8ac60b8a80268cab7e6383/src/Aspire.Hosting/ApplicationModel/ResourceCommandAnnotation.cs)

The service provider.

```csharp
public IServiceProvider ServiceProvider { get; init; }
```

## ATS metadata

### Ignored by ATS

- Reason: IServiceProvider is not usable from polyglot command callbacks.
