# IComputeEnvironmentResource Methods

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

Represents a compute environment resource.

## GetHostAddressExpression(EndpointReference)

> **Experimental:** ASPIRECOMPUTE002 - [Learn more](/diagnostics/aspirecompute002/)

- Name: `GetHostAddressExpression(EndpointReference)`
- Modifiers: `virtual`
- Returns: [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/IComputeEnvironmentResource.cs#L22)

Gets a [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) representing the host address or host name for the specified [EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md).

```csharp
public interface IComputeEnvironmentResource
{
    public virtual ReferenceExpression GetHostAddressExpression(
        EndpointReference endpointReference)
    {
        // ...
    }
}
```

## Parameters

- `endpointReference` ([EndpointReference](/reference/api/csharp/aspire.hosting/endpointreference.md))
  The endpoint reference for which to retrieve the host address or host name.

## Returns

[ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) -- A [ReferenceExpression](/reference/api/csharp/aspire.hosting/referenceexpression.md) representing the host address or host name (not a full URL).

## Remarks

The returned value typically contains only the host name or address, without scheme, port, or path information.
