# RustAppResource.withCargoLocked

- Module: [Aspire.Hosting.Rust](/reference/api/typescript/aspire.hosting.rust.md)
- Defined on: [RustAppResource](/reference/api/typescript/aspire.hosting.rust/rustappresource.md)
- Version: `13.6.0-preview.1.26478.8`
- Kind: `method`

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;
}
```

## Signature

```typescript
withCargoLocked(locked?: boolean): RustAppResource
```

## Parameters

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

## Returns

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

## Defined on

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