ResolvedPort
Struct readonly net10.0
Represents a resolved port with information about whether it was allocated or explicitly specified.
namespace Aspire.Hosting.ApplicationModel;
public sealed readonly struct ResolvedPort{ // ...} 8 members
Properties3
Section titled PropertiesIsAllocatedget; initbool Gets a value indicating whether the port was dynamically allocated. When true, the target environment may choose to ignore this port and use its own allocation mechanism. When false, the port was explicitly specified and should be used as-is.
IsImplicitget; initbool Gets a value indicating whether the port was implicitly inferred from another value. When true, the port was derived (e.g., exposed port matching target port) rather than explicitly specified by the user.
Valueget; initint? Gets the port number, or null if no port was resolved.
Methods5
Section titled MethodsAllocated(int)static Creates a
ResolvedPort with an allocated port. Explicit(int)static Creates a
ResolvedPort with an explicitly specified port. Implicit(int)static Creates a
ResolvedPort with an implicitly inferred port. Nonestatic Creates a
ResolvedPort with no port (null). op_Implicit(ResolvedPort)staticint? Implicitly converts a
ResolvedPort to a nullable int.