# RustAppResource.WithCargoProfile

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

Configures the named cargo profile to build with.

## Remarks

Passed to cargo as `--profile`, which takes precedence over `WithCargoReleaseBuild` because
cargo rejects `--profile` and `--release` together.

## Definition

```go
type RustAppResource interface {
    // ... omitted for brevity
    WithCargoProfile(profileName string) RustAppResource
}
```

## Signature

```go
WithCargoProfile(profileName string) RustAppResource
```

## Parameters

- `profileName` (`string`) -- The profile name, for example `dev`, `release`, or a custom profile.

## Returns

[`RustAppResource`](/reference/api/go/aspire.hosting.rust/rustappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Defined on

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