# AllocatedEndpoint

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/ApplicationModel/AllocatedEndpoint.cs)

Represents an endpoint allocated for a service instance.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class AllocatedEndpoint
{
    // ...
}
```

## Constructors

- [AllocatedEndpoint(EndpointAnnotation, string, int, EndpointBindingMode, string?, NetworkIdentifier?)](/reference/api/csharp/aspire.hosting/allocatedendpoint/constructors.md#constructor-endpointannotation-string-int-endpointbindingmode-string-networkidentifier) -- Initializes a new instance of the [AllocatedEndpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint.md) class.
- [AllocatedEndpoint(EndpointAnnotation, string, int, EndpointBindingMode, string?)](/reference/api/csharp/aspire.hosting/allocatedendpoint/constructors.md#constructor-endpointannotation-string-int-endpointbindingmode-string) -- Initializes a new instance of the [AllocatedEndpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint.md) class.
- [AllocatedEndpoint(EndpointAnnotation, string, int, string?)](/reference/api/csharp/aspire.hosting/allocatedendpoint/constructors.md#constructor-endpointannotation-string-int-string) -- Initializes a new instance of the [AllocatedEndpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint.md) class.

## Properties

- [Address](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#address) : `string` `get` -- The address of the endpoint
- [BindingMode](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#bindingmode) : [EndpointBindingMode](/reference/api/csharp/aspire.hosting/endpointbindingmode.md) `get` -- The binding mode of the endpoint, indicating whether it is a single address endpoint or is bound to all IPv4 or IPv6 addresses (or both).
- [Endpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#endpoint) : [EndpointAnnotation](/reference/api/csharp/aspire.hosting/endpointannotation.md) `get` -- Gets the endpoint which this allocation is associated with.
- [EndPointString](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#endpointstring) : `string` `get` -- Endpoint in string representation formatted as `"Address:Port"`.
- [NetworkID](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#networkid) : [NetworkIdentifier](/reference/api/csharp/aspire.hosting/networkidentifier.md) `get` -- Gets the network identifier for the network associated with the [AllocatedEndpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint.md) instance.
- [Port](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#port) : `int` `get` -- The port used by the endpoint
- [TargetPortExpression](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#targetportexpression) : `string?` `get` -- A string representing how to retrieve the target port of the [AllocatedEndpoint](/reference/api/csharp/aspire.hosting/allocatedendpoint.md) instance.
- [UriScheme](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#urischeme) : `string` `get` -- For URI-addressed services, contains the scheme part of the address.
- [UriString](/reference/api/csharp/aspire.hosting/allocatedendpoint/properties.md#uristring) : `string` `get` -- URI in string representation.

## Methods

- [ToString](/reference/api/csharp/aspire.hosting/allocatedendpoint/methods.md#tostring) : `string` -- Returns a string representation of the allocated endpoint URI.
