# withVolume

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Version: `17.0.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds a volume to an executable resource.

## Definition

```typescript
interface ExecutableResource {
  // ... omitted for brevity
  withVolume(
    target: string,
    name: string,
    env: string,
    isReadOnly?: boolean): ExecutableResource
}
```

## Parameters

- `target` (`string`)
- `name` (`string`)
- `env` (`string`)
- `isReadOnly` (`boolean`) `optional` `= False`

## Returns

[ExecutableResource](/reference/api/typescript/aspire.hosting/executableresource.md) `builder`

## Applies to

- [ExecutableResource](/reference/api/typescript/aspire.hosting/executableresource.md)
- [DotnetToolResource](/reference/api/typescript/aspire.hosting/dotnettoolresource.md)
