29 writes to Url
Aspire.Hosting (12)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45
Url
= Url,
Orchestrator\ApplicationOrchestrator.cs (6)
237
var url = new ResourceUrlAnnotation {
Url
= allocatedEndpoint.UriString, Endpoint = endpointReference };
250
Url
= $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}",
259
Url
= $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}",
291
Url
= $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}",
369
url.
Url
= uriBuilder.Uri.ToString();
383
url.
Url
= allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (2)
617
url.
Url
= launchProfile.LaunchUrl;
623
url.
Url
= (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (3)
1120
u.
Url
= uri.ToString();
1128
return builder.WithAnnotation(new ResourceUrlAnnotation {
Url
= url, DisplayText = displayText });
1177
c.Urls.Add(new() { Endpoint = endpoint,
Url
= urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
538
tunnelUrl.
Url
= new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/');
565
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 (12)
WithUrlsTests.cs (12)
141
.WithUrls(c => c.Urls.Add(new() {
Url
= "https://example.com", DisplayText = "Example" }))
345
u.
Url
= "https://example.com";
375
.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 });
744
return new() {
Url
= "https://example.com" };
770
.WithUrls(c => c.Urls.Add(new() {
Url
= "https://callback-before.com/sub-path", DisplayText = "Example" }))
773
.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
820
url.
Url
= "/sub-path";
850
return new() {
Url
= "/sub-path" };
880
c.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 (1)
Program.cs (1)
75
.WithUrlForEndpoint("https", ep => new() {
Url
= "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
51 references to Url
Aspire.Hosting (12)
ApplicationModel\ResourceUrlAnnotation.cs (1)
45
Url =
Url
,
Dcp\ResourceSnapshotBuilder.cs (2)
258
urls.Add(new(Name: endpointUrl.Endpoint!.EndpointName, Url: endpointUrl.
Url
, IsInternal: endpointUrl.IsInternal) { IsInactive = isInactive, DisplayProperties = new(endpointUrl.DisplayText ?? "", endpointUrl.DisplayOrder ?? 0) });
266
urls.Add(new(Name: null, Url: url.
Url
, IsInternal: url.IsInternal) { IsInactive = !resourceRunning, DisplayProperties = new(url.DisplayText ?? "", url.DisplayOrder ?? 0) });
Orchestrator\ApplicationOrchestrator.cs (7)
151
urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.
Url
, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly)
356
var primaryUri = new Uri(primaryUrl.
Url
);
363
if (url.Endpoint?.EndpointAnnotation == primaryLaunchProfileEndpoint && !string.Equals(url.
Url
, primaryUrl.
Url
, StringComparisons.Url))
365
var uriBuilder = new UriBuilder(url.
Url
)
381
if (url.
Url
.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint)
383
url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.
Url
;
ProjectResourceBuilderExtensions.cs (1)
622
var baseUri = new Uri(url.
Url
);
ResourceBuilderExtensions.cs (1)
1117
if (Uri.TryCreate(u.
Url
, UriKind.Absolute, out var absoluteUri)
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (3)
536
&& !string.Equals(new UriBuilder(u.
Url
).Host, "localhost")) is { } tunnelUrl)
538
tunnelUrl.Url = new UriBuilder(tunnelUrl.
Url
).Uri.ToString().TrimEnd('/');
544
&& string.Equals(new UriBuilder(u.
Url
).Host, "localhost", StringComparison.OrdinalIgnoreCase)) is { } localhostTunnelUrl)
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
245
Assert.Single(urls, u => u.DisplayText == "Qdrant Dashboard" && u.
Url
.EndsWith("/dashboard"));
Aspire.Hosting.Tests (35)
WithEndpointTests.cs (4)
622
url => Assert.StartsWith("https://example.localhost:", url.
Url
),
623
url => Assert.StartsWith("https://localhost:", url.
Url
));
656
url => Assert.StartsWith("https://localhost:", url.
Url
),
657
url => Assert.StartsWith($"https://{Environment.MachineName}:", url.
Url
));
WithUrlsTests.cs (31)
153
Assert.Single(urls, u => u.
Url
== "https://example.com" && u.DisplayText == "Example");
177
Assert.Single(urls, u => u.
Url
== "https://example.com" && u.DisplayText == "Example");
205
u => Assert.True(u.
Url
== endpointUrl.
Url
&& u.DisplayText is null),
206
u => Assert.True(u.
Url
.EndsWith("/test") && u.DisplayText == "Example")
231
Assert.Single(urls, u => u.
Url
.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test");
267
Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.
Url
);
268
Assert.EndsWith("/sub-path", u.
Url
);
275
Assert.StartsWith("http://localhost", u.
Url
);
281
Assert.StartsWith("tcp://localhost", u.
Url
);
307
Assert.Single(urls, u => u.
Url
.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http");
330
Assert.Single(urls, u => u.
Url
== "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http");
361
u.
Url
== "https://example.com"
786
var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://static-before.com"));
787
var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://callback-before.com"));
788
var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://static-after.com"));
789
var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.
Url
.StartsWith("https://callback-after.com"));
793
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/test"));
796
Assert.Equal("https://static-before.com/test", staticBeforeUrl.
Url
);
799
Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.
Url
);
802
Assert.Equal("https://static-after.com/test", staticAfter.
Url
);
805
Assert.Equal("https://callback-after.com/sub-path", callbackAfter.
Url
);
835
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/sub-path"));
862
var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.
Url
.EndsWith("/sub-path"));
865
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/sub-path"));
892
var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.
Url
.EndsWith("/sub-path"));
895
Assert.True(endpointUrl.
Url
.StartsWith("http://localhost") && endpointUrl.
Url
.EndsWith("/sub-path"));