# Sandbox.CodeGenerator.GenerateAsync

```csharp
System.Threading.Tasks.Task<Result> GenerateAsync(System.Threading.CancellationToken cancellationToken = null)
```

Generates a complete source set from a snapshot of the current inputs, retaining the original inputs for later calls.
Cancellation is observed between generation stages; an active generator pass may finish before cancellation is observed.

### Parameters

- `cancellationToken` (`System.Threading.CancellationToken`), default `null`

### Returns

`System.Threading.Tasks.Task<Result>`

Declared in [Sandbox.CodeGenerator](/api/Sandbox.CodeGenerator).
Assembly: `Sandbox.Compiling`.
