# withCargoLocked

- Module: [Aspire.Hosting.Rust](/reference/api/typescript/aspire.hosting.rust.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62)

Configures the Rust application to build and run with the exact dependency versions recorded in `Cargo.lock`.

## Definition

```typescript
interface RustAppResource {
  // ... omitted for brevity
  withCargoLocked(locked?: boolean): RustAppResource
}
```

## Parameters

- `locked` (`boolean`) `optional` `= True`

## Returns

[RustAppResource](/reference/api/typescript/aspire.hosting.rust/rustappresource.md) `builder`

## Applies to

- [RustAppResource](/reference/api/typescript/aspire.hosting.rust/rustappresource.md)
