# LibTmux.Workspace.WorkspaceBuilder.BuildAsync

- **Module:** LibTmux.Workspace.WorkspaceBuilder
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux.Workspace/WorkspaceBuilder.cs#L61
- **Page:** https://libtmux.org/reference/dotnet/libtmux-workspace-workspacebuilder-buildasync/

```
LibTmux.Workspace.WorkspaceBuilder.BuildAsync(workspace: WorkspaceFile, cancellationToken: CancellationToken) -> Task<WorkspaceResult>
```

Builds a session from a workspace.

Readiness is inferred from the pane's current command and cursor position.
Startup output can resemble a prompt, and a prompt left at the origin can
time out; the builder never writes a readiness probe to the pane.

## Parameters

- `workspace` (WorkspaceFile) — The workspace to build.
- `cancellationToken` (CancellationToken) — Cancels the tmux commands.

## Returns

What was built, and what could not be.

## Raises

- `WorkspaceFormatException` — The workspace describes no session.
- `WorkspaceBuildException` — tmux failed after application began. The exception reports any materialized state.
