3 implementations of Addresses
Microsoft.AspNetCore.Hosting (1)
Server\Features\ServerAddressesFeature.cs (1)
14public ICollection<string> Addresses { get; } = new List<string>();
Microsoft.AspNetCore.Server.IIS (1)
Core\ServerAddressesFeature.cs (1)
10public ICollection<string> Addresses { get; set; } = Array.Empty<string>();
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\ServerAddressesFeature.cs (1)
16ICollection<string> IServerAddressesFeature.Addresses => InternalCollection.PublicCollection;
19 references to Addresses
Aspire.Dashboard.Tests (1)
Integration\MockOpenIdAuthority.cs (1)
122var authorityUrl = serverAddress.Addresses.First().Replace("127.0.0.1", "localhost");
Aspire.Hosting (1)
Dashboard\DashboardServiceHost.cs (1)
273_resourceServiceUri.SetResult(addressFeature.Addresses.Single());
Microsoft.AspNetCore (3)
WebApplication.cs (3)
69public ICollection<string> Urls => ServerFeatures.GetRequiredFeature<IServerAddressesFeature>().Addresses; 239var addresses = ServerFeatures.Get<IServerAddressesFeature>()?.Addresses; 246throw new InvalidOperationException($"Changing the URL is not supported because {nameof(IServerAddressesFeature.Addresses)} {nameof(ICollection<string>.IsReadOnly)}.");
Microsoft.AspNetCore.Hosting (3)
GenericHost\GenericWebHostService.cs (1)
67var addresses = serverAddressesFeature?.Addresses;
Internal\WebHost.cs (1)
263var addresses = serverAddressesFeature?.Addresses;
WebHostExtensions.cs (1)
122var serverAddresses = host.ServerFeatures.Get<IServerAddressesFeature>()?.Addresses;
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionMiddleware.cs (1)
141foreach (var address in _serverAddressesFeature.Addresses)
Microsoft.AspNetCore.Mvc.Testing (4)
WebApplicationFactory.cs (4)
233saf.Addresses.Clear(); 234saf.Addresses.Add($"http://127.0.0.1:{_kestrelPort}"); 378if (serverAddressFeature?.Addresses.Count > 0) 381_webHostAddress = new Uri(serverAddressFeature.Addresses.Last());
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
231server?.Features.Get<IServerAddressesFeature>()?.Addresses is { Count: > 0 } addresses)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\ServerAddressesCollection.cs (1)
169throw new InvalidOperationException($"{nameof(IServerAddressesFeature)}.{nameof(IServerAddressesFeature.Addresses)} cannot be modified after the server has started.");
Microsoft.AspNetCore.Testing (2)
ServiceFakesHostExtensions.cs (2)
73if (feature is null || feature.Addresses.Count == 0) 78return feature.Addresses
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\KestrelWebSocketServer.cs (1)
65.Addresses ?? [];
TestProject.ServiceA (1)
Program.cs (1)
15app.MapGet("/urls", (IServiceProvider sp) => sp.GetService<IServer>()?.Features?.Get<IServerAddressesFeature>()?.Addresses);