2 writes to Name
Aspire.Hosting (1)
ApplicationModel\EndpointAnnotation.cs (1)
98Name = name;
Aspire.Hosting.Tests (1)
ExpressionResolverTests.cs (1)
218Name = "http",
157 references to Name
Aspire.Hosting (41)
ApplicationModel\EndpointAnnotation.cs (1)
226AllocatedEndpointSnapshot.SetException(new InvalidOperationException($"The endpoint `{Name}` is not allocated"));
ApplicationModel\EndpointReference.cs (2)
161.SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName)); 207EndpointName = endpoint.Name;
ApplicationModel\ResourceExtensions.cs (2)
701endpoints.FirstOrDefault(e => StringComparers.EndpointAnnotationName.Equals(e.Name, endpointName)) : 724endpoints.FirstOrDefault(e => StringComparers.EndpointAnnotationName.Equals(e.Name, endpointName)) :
Dcp\DcpExecutor.cs (17)
1031throw new InvalidOperationException($"Service '{svc.Metadata.Name}' needs to specify a port for endpoint '{sp.EndpointAnnotation.Name}' since it isn't using a proxy."); 1117StringComparers.EndpointAnnotationName.Equals(swr.EndpointAnnotation.Name, endpoint.Name) 1122throw new InvalidDataException($"The '{endpoint.Name}' on resource '{ts.ResourceName}' should have an associated DCP Service resource already set up"); 1230svc.Annotate(CustomResource.EndpointNameAnnotation, endpoint.Name); 1294if (!processedEndpoints.Add((re.Resource.Name, endpoint.Name))) 1304endpoint.Name, 1320StringComparers.EndpointAnnotationName.Equals(swr.EndpointAnnotation.Name, endpoint.Name) 1325throw new InvalidDataException($"Host endpoint '{endpoint.Name}' on resource '{re.Resource.Name}' should have an associated DCP Service resource already set up"); 1344svc.Annotate(CustomResource.EndpointNameAnnotation, endpoint.Name); 2374throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 2381throw new InvalidOperationException($"Resource '{modelResourceName}' uses multiple replicas and a proxy-less endpoint '{ea.Name}'. These features do not work together."); 2386throw 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."); 2396$"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."); 2402$"Resource '{modelResourceName}' can have multiple replicas, and it uses endpoint '{ea.Name}' that has {nameof(ea.TargetPort)} property set. Each replica must have a unique port; setting {nameof(ea.TargetPort)} is not allowed."); 2949endpoint = endpoints.FirstOrDefault(e => StringComparers.EndpointAnnotationName.Equals(e.Name, endpointName));
Dcp\DcpNameGenerator.cs (1)
84: GetObjectNameForResource(resource, _options.Value, endpoint.Name);
Dcp\OtlpEndpointReferenceGatherer.cs (2)
56var grpcEndpoint = dashboardEndpoints.FirstOrDefault(e => e.Name == KnownEndpointNames.OtlpGrpcEndpointName); 57var httpEndpoint = dashboardEndpoints.FirstOrDefault(e => e.Name == KnownEndpointNames.OtlpHttpEndpointName);
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
47$"{@event.Resource.Name}-{endpoint.Name}");
Orchestrator\ApplicationOrchestrator.cs (7)
237_logger.LogTrace("Setting primary launch profile endpoint to '{EndpointName}' for resource '{ResourceName}'.", endpoint.Name, resource.Name); 329_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.Name, resource.Name); 336_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.Url, endpoint.Name, resource.Name); 394var primaryUrl = urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, primaryLaunchProfileEndpoint.Name, StringComparisons.EndpointAnnotationName)); 405_logger.LogTrace("Applying path '{Path}' from URL '{Url}' for primary launch profile endpoint '{EndpointName}' to other launch profile endpoints for resource '{ResourceName}'.", primaryPath, primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 430_logger.LogTrace("URL '{Url}' for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}' does not have a path to apply to other launch profile endpoints.", primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 438_logger.LogTrace("Could not find URL for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", primaryLaunchProfileEndpoint.Name, resource.Name);
ProjectResourceBuilderExtensions.cs (3)
611var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName)); 670projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 1001context.EnvironmentVariables[$"Kestrel__Endpoints__{e.EndpointAnnotation.Name}__Url"] = url;
Publishing\ManifestPublishingContext.cs (1)
496Writer.WriteStartObject(endpoint.Name);
ResourceBuilderExtensions.cs (4)
886.Where(ea => StringComparers.EndpointAnnotationName.Equals(ea.Name, endpointName)) 948if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 950throw new DistributedApplicationException($"Endpoint with name '{annotation.Name}' already exists. Endpoint name may not have been explicitly specified and was derived automatically from scheme argument (e.g. 'http', 'https', or 'tcp'). Multiple calls to WithEndpoint (and related methods) may result in a conflict if name argument is not specified. Each endpoint must have a unique name. For more information on networking in Aspire see: https://aka.ms/dotnet/aspire/networking");
Aspire.Hosting.Azure.AppContainers (4)
ContainerAppContext.cs (4)
153throw new NotSupportedException($"The endpoint(s) {string.Join(", ", unsupportedEndpoints.Select(r => $"'{r.Endpoint.Name}'"))} specify an unsupported scheme. The supported schemes are 'http', 'https', and 'tcp'."); 236_endpointMapping[endpoint.Name] = new(scheme, NormalizedContainerAppName, port, targetPort, true, httpIngress.External); 244.Select(r => r.Endpoint.Name) 268_endpointMapping[endpoint.Name] = new(endpoint.UriScheme, NormalizedContainerAppName, resolved.ExposedPort.Value ?? g.Port.Value, g.Port.Value, false, g.External);
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceWebsiteContext.cs (3)
107throw new NotSupportedException($"The endpoint(s) {string.Join(", ", unsupportedEndpoints.Select(r => $"'{r.Endpoint.Name}'"))} on resource '{resource.Name}' specifies an unsupported scheme. Only http and https are supported in App Service."); 128throw new NotSupportedException($"The endpoint '{endpoint.Name}' on resource '{resource.Name}' is not external. App Service only supports external endpoints."); 133_endpointMapping[endpoint.Name] = new(
Aspire.Hosting.Azure.Kusto.Tests (2)
AddAzureKustoTests.cs (2)
68var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http"); 359var httpEndpoint = endpointAnnotations.SingleOrDefault(e => e.Name == "http");
Aspire.Hosting.Azure.Tests (10)
AzureCosmosDBExtensionsTests.cs (4)
737var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 769var emulatorEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "emulator"); 798var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer"); 828var dataExplorerEndpoint = Assert.Single(cosmos.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "data-explorer");
AzureEventHubsExtensionsTests.cs (2)
246Assert.Equal("emulator", endpoints[0].Name); 249Assert.Equal("emulatorhealth", endpoints[1].Name);
AzureManagedRedisExtensionsTests.cs (1)
90Assert.Equal("tcp", endpoint.Name);
AzurePostgresExtensionsTests.cs (1)
185Assert.Equal("tcp", endpoint.Name);
AzureRedisExtensionsTests.cs (1)
134Assert.Equal("tcp", endpoint.Name);
AzureSqlExtensionsTests.cs (1)
152Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
528.SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, targetEndpoint.EndpointName)) is { } targetEndpointAnnotation) 534throw new ArgumentException($"Cannot tunnel endpoint '{targetEndpointAnnotation.Name}' with host '{targetEndpointAnnotation.TargetHost}' on resource '{targetResource.Name}' because it is not a localhost endpoint.", nameof(targetEndpoint));
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentContext.cs (2)
57serviceResource.EndpointMappings.Add(endpoint.Name, 64endpoint.Name));
Aspire.Hosting.Garnet.Tests (2)
AddGarnetTests.cs (2)
30Assert.Equal("tcp", endpoint.Name); 58Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (4)
32var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 35Assert.Equal("tcp", primaryEndpoint.Name); 41var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 44Assert.Equal("internal", internalEndpoint.Name);
Aspire.Hosting.Keycloak.Tests (4)
KeycloakResourceBuilderTests.cs (4)
30var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == defaultEndpointName); 33Assert.Equal(defaultEndpointName, endpoint.Name); 41var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName); 44Assert.Equal(managementEndpointName, healthEndpoint.Name);
Aspire.Hosting.Kubernetes (7)
KubernetesResource.cs (7)
189EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), httpMapping.Port, endpoint.Name); 199EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), HelmValue.Literal(portValue), endpoint.Name); 208var paramName = $"port_{endpoint.Name}".ToHelmValuesSectionName(); 214EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, GetKubernetesProtocolName(endpoint.Protocol), resource.Name.ToServiceName(), helmValue, endpoint.Name);
Aspire.Hosting.Milvus.Tests (5)
AddMilvusTests.cs (5)
36.FirstOrDefault(e => e.Name == "grpc"); 40Assert.Equal("grpc", endpoint.Name); 66.FirstOrDefault(e => e.Name == "grpc"); 70Assert.Equal("grpc", endpoint.Name); 195var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
47Assert.Equal("tcp", endpoint.Name); 75Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
57Assert.Equal("tcp", endpoint.Name); 96Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
107Assert.Equal("tcp", endpoint.Name); 153Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
55Assert.Equal("tcp", endpoint.Name); 94Assert.Equal("tcp", endpoint.Name); 176Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.PostgreSQL.Tests (4)
AddPostgresTests.cs (3)
65Assert.Equal("tcp", endpoint.Name); 119Assert.Equal("tcp", endpoint.Name); 212Assert.Equal("tcp", endpoint.Name);
PostgresMcpBuilderTests.cs (1)
33Assert.Equal(PostgresMcpContainerResource.PrimaryEndpointName, endpoint.Name);
Aspire.Hosting.Qdrant.Tests (8)
AddQdrantTests.cs (8)
56.FirstOrDefault(e => e.Name == "grpc"); 60Assert.Equal("grpc", endpoint.Name); 95.FirstOrDefault(e => e.Name == "http"); 100Assert.Equal("http", endpoint.Name); 128.FirstOrDefault(e => e.Name == "grpc"); 132Assert.Equal("grpc", endpoint.Name); 298var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 306var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
Aspire.Hosting.RabbitMQ.Tests (4)
AddRabbitMQTests.cs (4)
55var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp"); 58Assert.Equal("tcp", primaryEndpoint.Name); 66var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "management"); 69Assert.Equal("management", mangementEndpoint.Name);
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
252var secondaryEndpoint = endpoints.FirstOrDefault(ep => StringComparer.OrdinalIgnoreCase.Equals(ep.Name, RedisResource.SecondaryEndpointName));
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
43Assert.Equal("tcp", endpoint.Name); 71Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Seq.Tests (4)
AddSeqTests.cs (4)
29Assert.Equal("http", endpoint.Name); 57Assert.Equal("http", endpoint.Name); 183Assert.Equal("http", endpoint.Name); 216Assert.Equal("http", endpoint.Name);
Aspire.Hosting.SqlServer.Tests (1)
AddSqlServerTests.cs (1)
51Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Tests (32)
Dashboard\DashboardLifecycleHookTests.cs (1)
242var endpointAnnotation = dashboardResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == expectedScheme);
Dashboard\DashboardResourceTests.cs (5)
696if (endpoint.Name == KnownEndpointNames.OtlpGrpcEndpointName) 700else if (endpoint.Name == KnownEndpointNames.OtlpHttpEndpointName) 704else if (endpoint.Name == DashboardEventHandlers.McpEndpointName) 708else if (endpoint.Name == "http") 712else if (endpoint.Name == "https")
Dcp\DcpExecutorTests.cs (1)
893.WithEndpointsInEnvironment(e => e.Name != "dontinjectme")
EndpointReferenceTests.cs (1)
352var expression = destination.GetEndpoint(annotation.Name).Property(property);
KestrelConfigTests.cs (10)
29Assert.Equal("http", a.Name); 35Assert.Equal("ExplicitHttp", a.Name); 65Assert.Equal("http", a.Name); 71Assert.Equal("ExplicitHttp", a.Name); 98Assert.Equal("https", a.Name); 115Assert.Equal("FirstHttpEndpoint", a.Name); 123Assert.Equal("SecondHttpEndpoint", a.Name); 284.WithEndpointsInEnvironment(e => e.Name != "FirstHttpEndpoint") 285.WithEndpointsInEnvironment(e => e.Name != "ExplicitProxiedHttp"); 457endpoint.AllocatedEndpoint = new AllocatedEndpoint(endpoint, "localhost", endpoint.Port ?? 0, targetPortExpression: $"port_{endpoint.Name}");
ProjectResourceTests.cs (3)
309Assert.Equal("https", a.Name); 315Assert.Equal("http", a.Name); 392.WithEndpointsInEnvironment(filter: e => e.Name != "dontinjectme")
PublishAsDockerfileTests.cs (5)
301Assert.Equal("http", endpoint.Name); 325Assert.Equal("http", endpoint.Name); 343var endpoints = container.Annotations.OfType<EndpointAnnotation>().OrderBy(e => e.Name).ToList(); 348Assert.Equal("http", e.Name); 353Assert.Equal("https", e.Name);
WithEndpointTests.cs (6)
30.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 47.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 82.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 220Assert.Equal("mybinding", endpoints[0].Name); 514.WithEndpointsInEnvironment(e => e.Name != "dontinjectme"); 587.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single();
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
30Assert.Equal("tcp", endpoint.Name); 58Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Yarp.Tests (3)
AddYarpTests.cs (3)
30Assert.Equal("http", endpoint.Name); 423var httpsEndpoint = Assert.Single(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https"); 448Assert.DoesNotContain(yarp.Resource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "https");
TestProject.AppHost (1)
TestProgram.cs (1)
191["Name"] = endpoint.Name,