# ProcessCommandResultContext Properties

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [ProcessCommandResultContext](/reference/api/csharp/aspire.hosting/processcommandresultcontext.md)
- Kind: `Properties`
- Members: `8`

Context passed to callback to configure [ExecuteCommandResult](/reference/api/csharp/aspire.hosting/executecommandresult.md) when using [ResourceBuilderExtensions.WithProcessCommand(IResourceBuilder<TResource>, string, string, string, IReadOnlyList<string>, ProcessCommandOptions?)](/reference/api/csharp/aspire.hosting/resourcebuilderextensions/methods.md#withprocesscommand-iresourcebuilder-tresource-string-string-string-ireadonlylist-string-processcommandoptions).

## CancellationToken

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

Gets the cancellation token.

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

## ExitCode

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

Gets the process exit code.

```csharp
public int ExitCode { get; init; }
```

## Logger

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

Gets the logger for the command invocation.

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

## Output

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

Gets the retained stdout and stderr output lines in the order observed by the process runner.

```csharp
public IReadOnlyList<string> Output { get; init; }
```

## ProcessCommandSpec

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

Gets the process command specification used for the command invocation.

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

## ResourceName

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

Gets the name of the resource the command was configured on.

```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/ProcessCommandResultContext.cs)

Gets the service provider.

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

## TotalOutputLineCount

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

Gets the total number of stdout and stderr lines observed by the process runner.

```csharp
public int TotalOutputLineCount { get; init; }
```
