# LibTmux.Server.ValidateLayoutsAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Server.Layout.cs#L44
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-server-validatelayoutsasync/

```
LibTmux.Server.ValidateLayoutsAsync(layouts: IEnumerable<(string Layout, int PaneCount)>, cancellationToken: CancellationToken) -> Task
```

Checks layouts before a workspace changes the server.

Checks custom syntax, checksums, and minimum cell counts without checking
geometry. Version-sensitive names use the daemon version, or the client
version when no daemon is running. This never starts or changes a server.

## Parameters

- `layouts` (`IEnumerable<(string Layout, int PaneCount)>`): Layouts and the number of panes each must accommodate.
- `cancellationToken` (`CancellationToken`): Cancels version discovery.

## Returns

A task completing when every layout is safe to send.

## Raises

- [`ArgumentNullException`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): The layouts collection is null.
- [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): A layout or pane count is invalid.
- [`InvalidDataException`](https://learn.microsoft.com/dotnet/api/system.io.invaliddataexception): The daemon version reply is malformed.
- [`OperationCanceledException`](https://learn.microsoft.com/dotnet/api/system.operationcanceledexception): Validation was canceled.
- [`StaleServerGenerationException`](/en/csharp/latest/reference/libtmux-staleservergenerationexception/): The daemon changed.
- [`TmuxCommandException`](/en/csharp/latest/reference/libtmux-tmuxcommandexception/): The daemon version query failed.
