32 writes to Url
Aspire.Hosting (12)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45Url = Url,
Orchestrator\ApplicationOrchestrator.cs (6)
237var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 250Url = $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}", 259Url = $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}", 291Url = $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}", 370url.Url = uriBuilder.Uri.ToString(); 384url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (2)
617url.Url = launchProfile.LaunchUrl; 623url.Url = (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (3)
1133u.Url = uri.ToString(); 1141return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 1190c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
541tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 568Url = new UriBuilder(portUri) { Host = $"{hostPrefix}-inspect{hostSuffix}" }.Uri.ToString(),
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
97.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Tests (13)
WithUrlsTests.cs (13)
140.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 344u.Url = "https://example.com"; 374.WithUrlForEndpoint("http", u => u.Url = "https://example.com"); 663c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 664c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 665c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 730return new() { Url = "https://example.com" }; 756.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 759.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-after.com/sub-path" })) // This won't get updated because it's added after the relative URL 823url.Url = "/test-sub-path"; 832url.Url = "/test-sub-path"; 875return new() { Url = "/sub-path" }; 905c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" });
Stress.AppHost (1)
Program.cs (1)
98.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (3)
AppHost.cs (3)
57u.Url = "/"; 63Url = "/swagger", 89.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
54 references to Url
Aspire.Hosting (13)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45Url = Url,
Dcp\ResourceSnapshotBuilder.cs (2)
258urls.Add(new(Name: endpointUrl.Endpoint!.EndpointName, Url: endpointUrl.Url, IsInternal: endpointUrl.IsInternal) { IsInactive = isInactive, DisplayProperties = new(endpointUrl.DisplayText ?? "", endpointUrl.DisplayOrder ?? 0) }); 266urls.Add(new(Name: null, Url: url.Url, IsInternal: url.IsInternal) { IsInactive = !resourceRunning, DisplayProperties = new(url.DisplayText ?? "", url.DisplayOrder ?? 0) });
Orchestrator\ApplicationOrchestrator.cs (8)
151urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 356Uri.TryCreate(primaryUrl.Url, UriKind.RelativeOrAbsolute, out var primaryUri); 357var primaryPath = primaryUri?.IsAbsoluteUri == true ? primaryUri.AbsolutePath : primaryUrl.Url; 364if (url.Endpoint?.EndpointAnnotation == primaryLaunchProfileEndpoint && !string.Equals(url.Url, primaryUrl.Url, StringComparisons.Url)) 366var uriBuilder = new UriBuilder(url.Url) 382if (url.Url.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint) 384url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (1)
622var baseUri = new Uri(url.Url);
ResourceBuilderExtensions.cs (1)
1130if (Uri.TryCreate(u.Url, UriKind.Absolute, out var absoluteUri)
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (3)
539&& !string.Equals(new UriBuilder(u.Url).Host, "localhost")) is { } tunnelUrl) 541tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 547&& string.Equals(new UriBuilder(u.Url).Host, "localhost", StringComparison.OrdinalIgnoreCase)) is { } localhostTunnelUrl)
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
248Assert.Single(urls, u => u.DisplayText == "Qdrant Dashboard" && u.Url.EndsWith("/dashboard"));
Aspire.Hosting.Tests (37)
WithEndpointTests.cs (4)
622url => Assert.StartsWith("https://example.localhost:", url.Url), 623url => Assert.StartsWith("https://localhost:", url.Url)); 656url => Assert.StartsWith("https://localhost:", url.Url), 657url => Assert.StartsWith($"https://{Environment.MachineName}:", url.Url));
WithUrlsTests.cs (33)
152Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 176Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 204u => Assert.True(u.Url == endpointUrl.Url && u.DisplayText is null), 205u => Assert.True(u.Url.EndsWith("/test") && u.DisplayText == "Example") 230Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 266Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.Url); 267Assert.EndsWith("/sub-path", u.Url); 274Assert.StartsWith("http://localhost", u.Url); 280Assert.StartsWith("tcp://localhost", u.Url); 306Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 329Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 360u.Url == "https://example.com" 772var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 773var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 774var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 775var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 779Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/test")); 782Assert.Equal("https://static-before.com/test", staticBeforeUrl.Url); 785Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.Url); 788Assert.Equal("https://static-after.com/test", staticAfter.Url); 791Assert.Equal("https://callback-after.com/sub-path", callbackAfter.Url); 848Assert.StartsWith(useHttps ? "https://localhost" : "http://localhost", endpointUrl.Url); 849Assert.EndsWith("/test-sub-path", endpointUrl.Url); 857Assert.StartsWith("http://localhost", launchProfileUrl.Url); 858Assert.EndsWith("/test-sub-path", launchProfileUrl.Url); 887var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 890Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path")); 917var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 920Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path"));