# LibTmux.Server.CaptureSnapshotAsync

- **Module:** LibTmux.Server
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Server.Snapshots.cs#L60
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-server-capturesnapshotasync/

```
LibTmux.Server.CaptureSnapshotAsync(depth: SnapshotDepth, cancellationToken: CancellationToken) -> Task<Server>
```

Reads the server and answers a handle carrying what it found.

A handle that has not yet found a live server discovers one first,
because a scope hands back the unmaterialized endpoint it started.

## Parameters

- `depth` (SnapshotDepth): How far down the hierarchy to read.
- `cancellationToken` (CancellationToken): Cancels the tmux commands.

## Returns

A handle whose relations are the ones this reading found.

## Raises

- `InvalidOperationException`: The handle has no connection.
