# IPipelineOutputComparer<TSnapshot> Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [IPipelineOutputComparer<TSnapshot>](/reference/api/csharp/aspire.hosting/ipipelineoutputcomparer-1.md)
- Kind: `Methods`
- Members: `1`

Compares pipeline output snapshots and reports differences as [PipelineOutputChange](/reference/api/csharp/aspire.hosting/pipelineoutputchange.md) values.

<a id="compareasync"></a>
<a id="compareasync-tsnapshot-tsnapshot-cancellationtoken"></a>

## CompareAsync(TSnapshot, TSnapshot, CancellationToken)

- Name: `CompareAsync(TSnapshot, TSnapshot, CancellationToken)`
- Modifiers: `abstract`
- Returns: [Task<IReadOnlyList<PipelineOutputChange>>](/reference/api/csharp/aspire.hosting/pipelineoutputchange.md)

Compares output captured before and after artifact generation.

```csharp
public interface IPipelineOutputComparer<TSnapshot>
{
    public abstract Task<IReadOnlyList<PipelineOutputChange>> CompareAsync(
        TSnapshot before,
        TSnapshot after,
        CancellationToken cancellationToken)
    {
        // ...
    }
}
```

## Parameters

- `before` (`TSnapshot`)
  The snapshot captured before generation.
- `after` (`TSnapshot`)
  The snapshot captured after generation.
- `cancellationToken` (`CancellationToken`)
  The cancellation token.

## Returns

[Task<IReadOnlyList<PipelineOutputChange>>](/reference/api/csharp/aspire.hosting/pipelineoutputchange.md) -- The changes with output-directory-relative paths. An empty list passes the output check.
