# VolumeMountBindingAnnotation Constructors

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

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

<a id="constructor"></a>
<a id="constructor-string"></a>

## VolumeMountBindingAnnotation(string)

- Name: `Constructor(string)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting/ApplicationModel/VolumeMountBindingAnnotation.cs#L41-L46)

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

```csharp
public sealed class VolumeMountBindingAnnotation
{
    public VolumeMountBindingAnnotation(
        string volumeName)
    {
        // ...
    }
}
```

## Parameters

- `volumeName` (`string`)

## Remarks

This annotation is the extensibility point compute environments use to participate in the portable volume path convention. It carries two independent facets, either of which may be absent:

- [VolumeMountBindingAnnotation.EnvironmentVariableName](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#environmentvariablename) records that the workload reads the effective storage path from an environment variable. The variable itself is written by an [EnvironmentCallbackAnnotation](/reference/api/csharp/aspire.hosting/environmentcallbackannotation.md) whose closure captures the name, which makes the intent invisible to anything inspecting the model. Restating it here lets a compute environment tell whether a host process materializes a local backing store for the volume, without having to observe the callback running.
- [VolumeMountBindingAnnotation.RunModeHostPathResolver](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#runmodehostpathresolver) lets a compute environment supply the local directory that backs the volume in run mode. Without it, host processes fall back to a workload-scoped directory under [IAspireStore](/reference/api/csharp/aspire.hosting/iaspirestore.md).

The two facets are produced by different parties at different times -- the AppHost author opts into the environment variable, while the compute environment supplies the local path -- so a resource can carry several of these annotations for the same [VolumeMountBindingAnnotation.VolumeName](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#volumename). A binding resolves through its own [VolumeMountBindingAnnotation.RunModeHostPathResolver](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#runmodehostpathresolver) when it has one, and otherwise takes the last sibling that does. [VolumeMountBindingAnnotation.VolumeName](/reference/api/csharp/aspire.hosting/volumemountbindingannotation/properties.md#volumename) alone is not a unique key, because separate compute environments can each declare a volume under the same name.
