# LibTmux.Workspace.WorkspaceBuilder.BuildAsync

- **Module:** LibTmux.Workspace.WorkspaceBuilder
- **Package:** LibTmux.Workspace
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux.Workspace/WorkspaceBuilder.cs#L61
- **Page:** https://libtmux.org/en/dotnet/latest/workspace/reference/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.
