# VolumeMountBindingAnnotation Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [VolumeMountBindingAnnotation](/reference/api/csharp/aspire.hosting/volumemountbindingannotation.md)
- Kind: `Methods`
- Members: `1`

Describes how a named volume binds to a resource across the inner and outer loop.

<a id="resolvepath"></a>
<a id="resolvepath-environmentcallbackcontext"></a>

## ResolvePath(EnvironmentCallbackContext)

- Name: `ResolvePath(EnvironmentCallbackContext)`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting/ApplicationModel/VolumeMountBindingAnnotation.cs#L79-L120)

Resolves the storage path the workload should use for the current execution mode.

```csharp
public sealed class VolumeMountBindingAnnotation
{
    public string ResolvePath(
        EnvironmentCallbackContext context)
    {
        // ...
    }
}
```

## Parameters

- `context` ([EnvironmentCallbackContext](/reference/api/csharp/aspire.hosting/environmentcallbackcontext.md))
  The environment callback context being evaluated.

## Returns

`string` -- [VolumeMountBindingAnnotation.MountPath](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#mountpath) when publishing or when the workload runs as a container, and otherwise a local host directory.

## Exceptions

- `InvalidOperationException` -- Thrown when the deployed mount path is required but this binding does not declare one.
