# IComputeEnvironmentWithVolumeMounts

- Kind: `interface`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.6.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62/src/Aspire.Hosting/ApplicationModel/IComputeEnvironmentWithVolumeMounts.cs)
- Implements: [IComputeEnvironmentResource](/reference/api/csharp/aspire.hosting/icomputeenvironmentresource.md), [IResource](/reference/api/csharp/aspire.hosting/iresource.md)

Implemented by compute environments that materialize volume mounts for the workloads they host.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public interface IComputeEnvironmentWithVolumeMounts
    : Aspire.Hosting.ApplicationModel.IComputeEnvironmentResource,
      Aspire.Hosting.ApplicationModel.IResource
{
    // ...
}
```

## Remarks

Binding a volume to an environment variable promises the workload that reading that variable yields a path backed by storage. Only a compute environment that consumes [ContainerMountAnnotation](/reference/api/csharp/aspire.hosting/containermountannotation.md) can keep that promise, so those environments declare the capability by implementing this interface.

When the target environment does not implement this interface, resolving the variable fails at publish time rather than emitting a path that resolves to ordinary writable container storage. Without the check the failure is silent and late: writes succeed, and the data disappears when the workload restarts or is rescheduled.
