Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

PortAllocator

Classsealednet10.0
📦 Aspire.Hosting v13.5.4
Allocates and manages a range of ports for use in an application context.
namespace Aspire.Hosting.ApplicationModel;
public sealed class PortAllocator
: Aspire.Hosting.ApplicationModel.IPortAllocator
{
// ...
}
This class starts allocating ports from a specified initial port (default is 8000) and ensures that allocated ports do not overlap with ports already marked as used.
View all constructors
View all methods