# IContainerRuntimeResolver Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [IContainerRuntimeResolver](/reference/api/csharp/aspire.hosting/icontainerruntimeresolver.md)
- Kind: `Methods`
- Members: `1`

Resolves the configured or auto-detected container runtime asynchronously. The result is cached after the first resolution.

## ResolveAsync(CancellationToken)

- Name: `ResolveAsync(CancellationToken)`
- Modifiers: `abstract`
- Returns: [Task<IContainerRuntime>](/reference/api/csharp/aspire.hosting/icontainerruntime.md)

Resolves the container runtime, detecting it from the environment if not explicitly configured. The result is cached after the first call.

```csharp
public interface IContainerRuntimeResolver
{
    public abstract Task<IContainerRuntime> ResolveAsync(
        CancellationToken cancellationToken = default(CancellationToken))
    {
        // ...
    }
}
```

## Parameters

- `cancellationToken` (`CancellationToken`) `optional`
  A token to cancel the operation.

## Returns

[Task<IContainerRuntime>](/reference/api/csharp/aspire.hosting/icontainerruntime.md) -- The resolved container runtime.
