34 writes to Url
Aspire.Hosting (12)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45
Url
= Url,
Orchestrator\ApplicationOrchestrator.cs (6)
250
var url = new ResourceUrlAnnotation {
Url
= allocatedEndpoint.UriString, Endpoint = endpointReference };
263
Url
= $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}",
272
Url
= $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}",
305
Url
= $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}",
420
url.
Url
= uriBuilder.Uri.ToString();
456
url.
Url
= allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (2)
613
url.
Url
= launchProfile.LaunchUrl;
619
url.
Url
= (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (3)
1178
u.
Url
= uri.ToString();
1186
return builder.WithAnnotation(new ResourceUrlAnnotation {
Url
= url, DisplayText = displayText });
1235
c.Urls.Add(new() { Endpoint = endpoint,
Url
= urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
541
tunnelUrl.
Url
= new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/');
568
Url
= 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 (15)
WithUrlsTests.cs (15)
140
.WithUrls(c => c.Urls.Add(new() {
Url
= "https://example.com", DisplayText = "Example" }))
344
u.
Url
= "https://example.com";
374
.WithUrlForEndpoint("http", u => u.
Url
= "https://example.com");
663
c.Urls.Add(new() {
Url
= "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails });
664
c.Urls.Add(new() {
Url
= "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly });
665
c.Urls.Add(new() {
Url
= "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 });
730
return 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
818
url.
Url
= "/test-sub-path";
851
url.
Url
= "/test-sub-path";
857
Url
= "/test-another-sub-path",
899
return new() {
Url
= "/sub-path" };
929
c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"),
Url
= "/sub-path" });
966
Url
= "/",
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)
57
u.
Url
= "/";
63
Url
= "/swagger",
89
.WithUrlForEndpoint("https", ep => new() {
Url
= "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
67 references to Url
Aspire.Hosting (24)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45
Url =
Url
,
Dcp\ResourceSnapshotBuilder.cs (3)
274
Url: endpointUrl.
Url
,
302
new(Name: endpointName, Url: endpointUrl.
Url
, IsInternal: endpointUrl.IsInternal)
313
new(Name: null, Url: url.
Url
, IsInternal: url.IsInternal)
Orchestrator\ApplicationOrchestrator.cs (18)
155
urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.
Url
, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly)
331
_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.
Url
, endpoint.Name, resource.Name);
338
_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.
Url
, endpoint.Name, resource.Name);
352
_logger.LogTrace("Added static URL '{Url}' for resource '{ResourceName}'.", staticUrl.
Url
, resource.Name);
399
Uri.TryCreate(primaryUrl.
Url
, UriKind.RelativeOrAbsolute, out var primaryUri);
400
var primaryPath = primaryUri?.IsAbsoluteUri == true ? primaryUri.AbsolutePath : primaryUrl.
Url
;
407
_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);
412
&& !string.Equals(url.
Url
, primaryUrl.
Url
, StringComparisons.Url)
413
&& Uri.IsWellFormedUriString(url.
Url
, UriKind.Absolute))
417
_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.
Url
, primaryPath, url.Endpoint.EndpointName, resource.Name);
419
var uriBuilder = new UriBuilder(url.
Url
) { Path = primaryPath };
423
_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.
Url
, url.Endpoint.EndpointName, resource.Name);
432
_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);
454
if (url.
Url
.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint)
456
url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.
Url
;
459
_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.
Url
, endpoint.EndpointName, resource.Name);
473
_logger.LogTrace("Added URL annotation '{Url}' to resource '{ResourceName}'.", url.
Url
, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
618
var baseUri = new Uri(url.
Url
);
ResourceBuilderExtensions.cs (1)
1175
if (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)
541
tunnelUrl.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)
248
Assert.Single(urls, u => u.DisplayText == "Qdrant Dashboard" && u.
Url
.EndsWith("/dashboard"));
Aspire.Hosting.Tests (39)
WithEndpointTests.cs (4)
618
url => Assert.StartsWith("https://example.localhost:", url.
Url
),
619
url => Assert.StartsWith("https://localhost:", url.
Url
));
652
url => Assert.StartsWith("https://localhost:", url.
Url
),
653
url => Assert.StartsWith($"https://{Environment.MachineName}:", url.
Url
));
WithUrlsTests.cs (35)
152
Assert.Single(urls, u => u.
Url
== "https://example.com" && u.DisplayText == "Example");
176
Assert.Single(urls, u => u.
Url
== "https://example.com" && u.DisplayText == "Example");
204
u => Assert.True(u.
Url
== endpointUrl.
Url
&& u.DisplayText is null),
205
u => Assert.True(u.
Url
.EndsWith("/test") && u.DisplayText == "Example")
230
Assert.Single(urls, u => u.
Url
.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test");
266
Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.
Url
);
267
Assert.EndsWith("/sub-path", u.
Url
);
274
Assert.StartsWith("http://localhost", u.
Url
);
280
Assert.StartsWith("tcp://localhost", u.
Url
);
306
Assert.Single(urls, u => u.
Url
.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http");
329
Assert.Single(urls, u => u.
Url
== "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http");
360
u.
Url
== "https://example.com"
772
var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://static-before.com"));
773
var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://callback-before.com"));
774
var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://static-after.com"));
775
var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://callback-after.com"));
779
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/test"));
782
Assert.Equal("https://static-before.com/test", staticBeforeUrl.
Url
);
785
Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.
Url
);
788
Assert.Equal("https://static-after.com/test", staticAfter.
Url
);
791
Assert.Equal("https://callback-after.com/sub-path", callbackAfter.
Url
);
834
Assert.StartsWith(useHttps ? "https://localhost" : "http://localhost", endpointUrl.
Url
);
835
Assert.EndsWith("/test-sub-path", endpointUrl.
Url
);
874
Assert.StartsWith("http://localhost", url.
Url
);
875
Assert.EndsWith("/test-sub-path", url.
Url
);
880
Assert.StartsWith("http://localhost", url.
Url
);
881
Assert.EndsWith("/test-another-sub-path", url.
Url
);
911
var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.
Url
.EndsWith("/sub-path"));
914
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/sub-path"));
941
var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.
Url
.EndsWith("/sub-path"));
944
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/sub-path"));