31 writes to Port
Aspire.Hosting (2)
ProjectResourceBuilderExtensions.cs (2)
395e.Port = endpoint.BindingAddress.Port; 454e.Port = bindingAddress.Port;
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
303endpoint.Port = ep;
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBExtensions.cs (2)
194endpoint.Port = port; 354endpoint.Port = port;
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
380endpoint.Port = port;
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
524endpoint.Port = port;
Aspire.Hosting.Azure.Storage (3)
AzureStorageExtensions.cs (3)
271endpoint.Port = port; 287endpoint.Port = port; 303endpoint.Port = port;
Aspire.Hosting.Docker (1)
DockerComposeAspireDashboardResourceBuilderExtensions.cs (1)
57e.Port = port;
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
160endpoint.Port = port;
Aspire.Hosting.MongoDB (1)
MongoDBBuilderExtensions.cs (1)
180endpoint.Port = port;
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
280endpoint.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)
273endpoint.Port = port; 289endpoint.Port = port; 437endpoint.Port = port;
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
226endpoint.Port = port;
Aspire.Hosting.Tests (8)
DistributedApplicationTests.cs (4)
1026endpoint.Port = null; 1048e.Port = 1234; 1084e.Port = 1234; 1091e.Port = 1543;
WithEndpointTests.cs (4)
25endpoint.Port = 2000; 41endpoint.Port = 2000; 95endpoint.Port = null; 99endpoint.Port = 2001;
Aspire.Hosting.Yarp (1)
YarpResourceExtensions.cs (1)
77endpoint.Port = port;
ProxylessEndToEnd.AppHost (1)
Program.cs (1)
15e.Port = 12345;
106 references to Port
Aspire.Hosting (12)
ApplicationModel\EndpointAnnotation.cs (1)
90/// Defaults to <see cref="Port"/>.
Dcp\DcpExecutor.cs (9)
884var port = _options.Value.RandomizePorts && endpoint.IsProxied ? null : endpoint.Port; 1601if (ea.Port is int && ea.Port != ea.TargetPort) 1603throw 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."); 1610if (ea.TargetPort is int && ea.Port is int && ea.TargetPort == ea.Port) 1613$"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."); 2004if (!ea.IsProxied && ea.Port is int) 2006portSpec.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)
257int? targetPort = (resource, endpoint.UriScheme, endpoint.TargetPort, endpoint.Port) switch 280int? exposedPort = (endpoint.UriScheme, endpoint.Port, targetPort) switch 383if (e.UriScheme is "http" && e.Port is not null and not 80) 388if (e.UriScheme is "https" && e.Port is not null and not 443) 416_endpointMapping[e.Name] = new(e.UriScheme, NormalizedContainerAppName, 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)
134Assert.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)
31Assert.Null(endpoint.Port); 59Assert.Equal(8813, endpoint.Port);
Aspire.Hosting.Kafka.Tests (3)
AddKafkaTests.cs (3)
34Assert.Null(primaryEndpoint.Port); 43Assert.Null(internalEndpoint.Port); 177Assert.Equal(port, kafkaUiEndpoint.Port);
Aspire.Hosting.Keycloak.Tests (2)
KeycloakResourceBuilderTests.cs (2)
34Assert.Null(endpoint.Port); 45Assert.Null(healthEndpoint.Port);
Aspire.Hosting.Milvus.Tests (3)
AddMilvusTests.cs (3)
41Assert.Null(endpoint.Port); 71Assert.Null(endpoint.Port); 194Assert.Equal(5503, grpcEndpoint.Port);
Aspire.Hosting.MongoDB.Tests (3)
AddMongoDBTests.cs (3)
32Assert.Null(endpoint.Port); 60Assert.Equal(9813, endpoint.Port); 139Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
57Assert.Null(endpoint.Port); 96Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
108Assert.Null(endpoint.Port); 154Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
56Assert.Null(endpoint.Port); 95Assert.Equal(1234, endpoint.Port); 177Assert.Equal(1234, endpoint.Port);
Aspire.Hosting.PostgreSQL.Tests (5)
AddPostgresTests.cs (5)
66Assert.Null(endpoint.Port); 120Assert.Equal(1234, endpoint.Port); 213Assert.Equal(1234, endpoint.Port); 426Assert.Equal(1000, endpoint.Port); 655Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Qdrant.Tests (5)
AddQdrantTests.cs (5)
61Assert.Null(endpoint.Port); 101Assert.Null(endpoint.Port); 133Assert.Null(endpoint.Port); 293Assert.Equal(5503, grpcEndpoint.Port); 301Assert.Equal(5504, httpEndpoint.Port);
Aspire.Hosting.RabbitMQ.Tests (3)
AddRabbitMQTests.cs (3)
59Assert.Null(primaryEndpoint.Port); 76Assert.Null(mangementEndpoint.Port); 80Assert.Equal(withManagementPluginPort.Value, mangementEndpoint.Port);
Aspire.Hosting.Redis.Tests (5)
AddRedisTests.cs (5)
39Assert.Null(endpoint.Port); 67Assert.Equal(9813, endpoint.Port); 415Assert.Equal(1000, endpoint.Port); 429Assert.Equal(1000, endpoint.Port); 441Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Seq.Tests (2)
AddSeqTests.cs (2)
30Assert.Null(endpoint.Port); 58Assert.Equal(9813, endpoint.Port);
Aspire.Hosting.SqlServer.Tests (2)
AddSqlServerTests.cs (2)
52Assert.Null(endpoint.Port); 261Assert.Equal(1000, endpoint.Port);
Aspire.Hosting.Tests (27)
KestrelConfigTests.cs (7)
30Assert.Equal(5002, a.Port); 66Assert.Equal(5031, a.Port); 72Assert.Equal(5017, a.Port); 99Assert.Equal(7002, a.Port); 116Assert.Equal(5002, a.Port); 124Assert.Equal(5003, a.Port); 462endpoint.AllocatedEndpoint = new AllocatedEndpoint(endpoint, "localhost", endpoint.Port ?? 0, targetPortExpression: $"port_{endpoint.Name}");
ProjectResourceTests.cs (10)
258Assert.Equal(7123, a.Port); 264Assert.Equal(5156, a.Port); 342e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 346e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p1"); 350e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p2"); 354e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p3"); 401e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 431e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: $"p{index++}"); 612e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p0"); 618e.AllocatedEndpoint = new(e, "localhost", e.Port!.Value, targetPortExpression: "p1");
SlimTestProgramTests.cs (2)
60Assert.Equal(endpoint.Port, endpoint.AllocatedEndpoint.Port); 79Assert.Equal(endpoint.Port, endpoint.AllocatedEndpoint.Port);
WithEndpointTests.cs (7)
30Assert.Equal(2000, endpoint.Port); 84Assert.Equal(2000, endpoint.Port); 88Assert.Null(endpoint.Port); 92Assert.Equal(2000, endpoint.Port); 96Assert.Null(endpoint.Port); 100Assert.Equal(2001, endpoint.Port); 610Assert.Equal(123, endpoint.Port);
WithUrlsTests.cs (1)
463endpoint.AllocatedEndpoint = new(endpoint, endpoint.TargetHost, endpoint.Port ?? endpoint.TargetPort ?? startingPort++);
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
31Assert.Null(endpoint.Port); 59Assert.Equal(8813, endpoint.Port);