30 writes to Port
Aspire.Hosting (2)
ProjectResourceBuilderExtensions.cs (2)
395e.Port = endpoint.BindingAddress.Port; 453e.Port = bindingAddress.Port;
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
263endpoint.Port = ep;
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBExtensions.cs (2)
197endpoint.Port = port; 346endpoint.Port = port;
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
376endpoint.Port = port;
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
521endpoint.Port = port;
Aspire.Hosting.Azure.Storage (3)
AzureStorageExtensions.cs (3)
224endpoint.Port = port; 240endpoint.Port = port; 256endpoint.Port = port;
Aspire.Hosting.Docker (1)
DockerComposeAspireDashboardResourceBuilderExtensions.cs (1)
57e.Port = port;
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
163endpoint.Port = port;
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
180endpoint.Port = port;
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
282endpoint.Port = port;
Aspire.Hosting.PostgreSQL (3)
PostgresBuilderExtensions.cs (3)
240endpoint.Port = port; 256endpoint.Port = port; 488endpoint.Port = port;
Aspire.Hosting.Redis (3)
RedisBuilderExtensions.cs (3)
277endpoint.Port = port; 293endpoint.Port = port; 441endpoint.Port = port;
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
229endpoint.Port = port;
Aspire.Hosting.Tests (8)
DistributedApplicationTests.cs (4)
1026endpoint.Port = null; 1048e.Port = 1234; 1084e.Port = 1234; 1091e.Port = 1543;
WithEndpointTests.cs (4)
26endpoint.Port = 2000; 42endpoint.Port = 2000; 96endpoint.Port = null; 100endpoint.Port = 2001;
ProxylessEndToEnd.AppHost (1)
Program.cs (1)
15e.Port = 12345;
105 references to Port
Aspire.Hosting (12)
ApplicationModel\EndpointAnnotation.cs (1)
90/// Defaults to <see cref="Port"/>.
Dcp\DcpExecutor.cs (9)
780var port = _options.Value.RandomizePorts && endpoint.IsProxied ? null : endpoint.Port; 1401if (ea.Port is int && ea.Port != ea.TargetPort) 1403throw new InvalidOperationException($"The endpoint '{ea.Name}' for resource '{modelResourceName}' is not using a proxy, and it has a value of {nameof(EndpointAnnotation.Port)} property that is different from the value of {nameof(EndpointAnnotation.TargetPort)} property. For proxy-less endpoints they must match."); 1410if (ea.TargetPort is int && ea.Port is int && ea.TargetPort == ea.Port) 1413$"The endpoint '{ea.Name}' for resource '{modelResourceName}' requested a proxy ({nameof(ea.IsProxied)} is true). Non-container resources cannot be proxied when both {nameof(ea.TargetPort)} and {nameof(ea.Port)} are specified with the same value."); 1773if (!ea.IsProxied && ea.Port is int) 1775portSpec.HostPort = ea.Port;
Publishing\ManifestPublishingContext.cs (2)
416int? targetPort = (resource, endpoint.UriScheme, endpoint.TargetPort, endpoint.Port) switch 439int? exposedPort = (endpoint.UriScheme, endpoint.Port, targetPort) switch
Aspire.Hosting.Azure.AppContainers (5)
ContainerAppContext.cs (5)
217int? targetPort = (resource, endpoint.UriScheme, endpoint.TargetPort, endpoint.Port) switch 240int? exposedPort = (endpoint.UriScheme, endpoint.Port, targetPort) switch 343if (e.UriScheme is "http" && e.Port is not null and not 80) 348if (e.UriScheme is "https" && e.Port is not null and not 443) 376_endpointMapping[e.Name] = new(e.UriScheme, resource.Name, e.Port ?? g.Port.Value, g.Port.Value, false, g.External);
Aspire.Hosting.Azure.Tests (17)
AzureCosmosDBExtensionsTests.cs (1)
35var actualPort = endpointAnnotation.Port;
AzureEventHubsExtensionsTests.cs (2)
247Assert.Equal(port, endpoints[0].Port); 250Assert.Null(endpoints[1].Port);
AzureFunctionsTests.cs (7)
51Assert.Equal(7071, endpointAnnotation.Port); 79Assert.Null(endpointAnnotation.Port); 102Assert.Equal(7072, endpointAnnotation.Port); 116Assert.Null(endpointAnnotation.Port); 130Assert.Null(endpointAnnotation.Port); 214Assert.Equal(7071, endpointAnnotation.Port); 258Assert.Null(endpointAnnotation.Port);
AzurePostgresExtensionsTests.cs (1)
184Assert.Equal(12455, endpoint.Port);
AzureRedisExtensionsTests.cs (1)
132Assert.Equal(12455, endpoint.Port);
AzureServiceBusExtensionsTests.cs (1)
165e => Assert.Equal(port, e.Port),
AzureSqlExtensionsTests.cs (1)
153Assert.Equal(12455, endpoint.Port);
AzureStorageExtensionsTests.cs (3)
133e => Assert.Equal(9001, e.Port), 134e => Assert.Equal(9002, e.Port), 135e => Assert.Equal(9003, e.Port));
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentContext.cs (1)
72var exposedPort = endpoint.Port;
Aspire.Hosting.Garnet.Tests (2)
AddGarnetTests.cs (2)
32Assert.Null(endpoint.Port); 60Assert.Equal(8813, endpoint.Port);
Aspire.Hosting.Kafka.Tests (3)
AddKafkaTests.cs (3)
35Assert.Null(primaryEndpoint.Port); 44Assert.Null(internalEndpoint.Port); 178Assert.Equal(port, kafkaUiEndpoint.Port);
Aspire.Hosting.Keycloak.Tests (2)
KeycloakResourceBuilderTests.cs (2)
35Assert.Null(endpoint.Port); 46Assert.Null(healthEndpoint.Port);
Aspire.Hosting.Milvus.Tests (3)
AddMilvusTests.cs (3)
42Assert.Null(endpoint.Port); 72Assert.Null(endpoint.Port); 195Assert.Equal(5503, grpcEndpoint.Port);
Aspire.Hosting.MongoDB.Tests (3)
AddMongoDBTests.cs (3)
33Assert.Null(endpoint.Port); 61Assert.Equal(9813, endpoint.Port); 136Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
58Assert.Null(endpoint.Port); 97Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
103Assert.Null(endpoint.Port); 149Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
57Assert.Null(endpoint.Port); 96Assert.Equal(1234, endpoint.Port); 178Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.PostgreSQL.Tests (5)
AddPostgresTests.cs (5)
67Assert.Null(endpoint.Port); 121Assert.Equal(1234, endpoint.Port); 212Assert.Equal(1234, endpoint.Port); 428Assert.Equal(1000, endpoint.Port); 655Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Qdrant.Tests (5)
AddQdrantTests.cs (5)
62Assert.Null(endpoint.Port); 102Assert.Null(endpoint.Port); 134Assert.Null(endpoint.Port); 294Assert.Equal(5503, grpcEndpoint.Port); 302Assert.Equal(5504, httpEndpoint.Port);
Aspire.Hosting.RabbitMQ.Tests (3)
AddRabbitMQTests.cs (3)
60Assert.Null(primaryEndpoint.Port); 77Assert.Null(mangementEndpoint.Port); 81Assert.Equal(withManagementPluginPort.Value, mangementEndpoint.Port);
Aspire.Hosting.Redis.Tests (5)
AddRedisTests.cs (5)
40Assert.Null(endpoint.Port); 68Assert.Equal(9813, endpoint.Port); 414Assert.Equal(1000, endpoint.Port); 428Assert.Equal(1000, endpoint.Port); 440Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Seq.Tests (2)
AddSeqTests.cs (2)
31Assert.Null(endpoint.Port); 59Assert.Equal(9813, endpoint.Port);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
53Assert.Null(endpoint.Port); 262Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Tests (26)
KestrelConfigTests.cs (7)
31Assert.Equal(5002, a.Port); 67Assert.Equal(5031, a.Port); 73Assert.Equal(5017, a.Port); 100Assert.Equal(7002, a.Port); 117Assert.Equal(5002, a.Port); 125Assert.Equal(5003, a.Port); 463endpoint.AllocatedEndpoint = new AllocatedEndpoint(endpoint, "localhost", endpoint.Port ?? 0, targetPortExpression: $"port_{endpoint.Name}");
ProjectResourceTests.cs (10)
259Assert.Equal(7123, a.Port); 265Assert.Equal(5156, a.Port); 343e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 347e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p1"); 351e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p2"); 355e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p3"); 402e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 432e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: $"p{index++}"); 613e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 619e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p1");
SlimTestProgramTests.cs (2)
58Assert.Equal(endpoint.Port, endpoint.AllocatedEndpoint.Port); 76Assert.Equal(endpoint.Port, endpoint.AllocatedEndpoint.Port);
WithEndpointTests.cs (7)
31Assert.Equal(2000, endpoint.Port); 85Assert.Equal(2000, endpoint.Port); 89Assert.Null(endpoint.Port); 93Assert.Equal(2000, endpoint.Port); 97Assert.Null(endpoint.Port); 101Assert.Equal(2001, endpoint.Port); 611Assert.Equal(123, endpoint.Port);
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
32Assert.Null(endpoint.Port); 60Assert.Equal(8813, endpoint.Port);