2 writes to ConfigurationLoader
InMemory.FunctionalTests (1)
HttpsConnectionMiddlewareTests.cs (1)
83options.ConfigurationLoader = loader; // Since we're constructing it explicitly, we have to hook it up explicitly
Microsoft.AspNetCore.Server.Kestrel.Core (1)
KestrelServerOptions.cs (1)
465ConfigurationLoader = loader;
85 references to ConfigurationLoader
CreateDefaultBuilderApp (1)
Program.cs (1)
22.Configure(options.ConfigurationLoader.Configuration)
CreateDefaultBuilderOfTApp (1)
Program.cs (1)
25.Configure(options.ConfigurationLoader.Configuration)
Microsoft.AspNetCore.Server.Kestrel.Core (11)
Internal\KestrelServerImpl.cs (7)
301if (Options.ConfigurationLoader?.ReloadOnChange == true && (!_serverAddresses.PreferHostingUrls || _serverAddresses.InternalCollection.Count == 0)) 303reloadToken = Options.ConfigurationLoader.GetReloadToken(); 306Options.ConfigurationLoader?.LoadInternal(); 307Options.ConfigurationLoader?.ProcessEndpointsToAdd(); 341Debug.Assert(Options.ConfigurationLoader != null, "Rebind can only happen when there is a ConfigurationLoader."); 343reloadToken = Options.ConfigurationLoader.GetReloadToken(); 344var (endpointsToStop, endpointsToStart) = Options.ConfigurationLoader.Reload();
KestrelServerOptions.cs (3)
267ConfigurationLoader?.ApplyEndpointDefaults(listenOptions); 282ConfigurationLoader?.ApplyHttpsDefaults(httpsOptions); 303if (ConfigurationLoader?.DefaultCertificate is X509Certificate2 certificateFromLoader)
ListenOptionsHttpsExtensions.cs (1)
170listenOptions.KestrelServerOptions.ConfigurationLoader?.LoadInternal();
Microsoft.AspNetCore.Server.Kestrel.Tests (72)
KestrelConfigurationLoaderTests.cs (72)
87serverOptions.ConfigurationLoader.Load(); 103Assert.Equal(builder, serverOptions.ConfigurationLoader); 109Assert.NotNull(serverOptions.ConfigurationLoader); 115Assert.NotNull(serverOptions.ConfigurationLoader); 141serverOptions.ConfigurationLoader.Load(); 321serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(endpointConfig.Concat(devCertConfig).Concat(defaultCertConfig)).Build(); 322_ = serverOptions.ConfigurationLoader.Reload(); 328serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(endpointConfig.Concat(devCertConfig)).Build(); 329_ = serverOptions.ConfigurationLoader.Reload(); 335serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(endpointConfig).Build(); 344Assert.Throws<InvalidOperationException>(() => serverOptions.ConfigurationLoader.Reload()); 346Assert.Null(serverOptions.ConfigurationLoader.DefaultCertificate); 353Assert.Equal(expectedCert.SerialNumber, serverOptions.ConfigurationLoader.DefaultCertificate.SerialNumber); 391Assert.ThrowsAny<CryptographicException>(() => serverOptions.ConfigurationLoader.Reload()); 398_ = serverOptions.ConfigurationLoader.Reload(); 429Assert.Null(serverOptions.ConfigurationLoader.DefaultCertificate); 431serverOptions.ConfigurationLoader.Load(); 433Assert.NotNull(serverOptions.ConfigurationLoader.DefaultCertificate); 434Assert.Equal(serverOptions.ConfigurationLoader.DefaultCertificate.SerialNumber, certificate.SerialNumber); 476Assert.Null(serverOptions.ConfigurationLoader.DefaultCertificate); 487Assert.NotNull(serverOptions.ConfigurationLoader.DefaultCertificate); 488Assert.Equal(serverOptions.ConfigurationLoader.DefaultCertificate.SerialNumber, certificate.SerialNumber); 491serverOptions.ConfigurationLoader.Load(); 537Assert.Null(serverOptions.ConfigurationLoader.DefaultCertificate); 539serverOptions.ConfigurationLoader.Load(); 541Assert.NotNull(serverOptions.ConfigurationLoader.DefaultCertificate); 542Assert.Equal(serverOptions.ConfigurationLoader.DefaultCertificate.SerialNumber, certificate.SerialNumber); 1480serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] 1487var (endpointsToStop, endpointsToStart) = serverOptions.ConfigurationLoader.Reload(); 1516serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] 1524var (endpointsToStop, endpointsToStart) = serverOptions.ConfigurationLoader.Reload(); 1559serverOptions.ConfigurationLoader.Configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] 1565serverOptions.ConfigurationLoader.Reload(); 1582Action load = loadInternal ? serverOptions.ConfigurationLoader.LoadInternal : serverOptions.ConfigurationLoader.Load; 1607var oldConfigurationLoader = serverOptions.ConfigurationLoader; 1611serverOptions.ConfigurationLoader.LoadInternal(); 1615serverOptions.ConfigurationLoader.Load(); 1623var newConfigurationLoader = serverOptions.ConfigurationLoader; 1628serverOptions.ConfigurationLoader.LoadInternal(); 1632serverOptions.ConfigurationLoader.Load(); 1650Action load = loadInternal ? serverOptions.ConfigurationLoader.LoadInternal : serverOptions.ConfigurationLoader.Load; 1677serverOptions.ConfigurationLoader.LoadInternal(); 1687serverOptions.ConfigurationLoader.LocalhostEndpoint(5000); 1689serverOptions.ConfigurationLoader.Load(); 1703serverOptions.ConfigurationLoader.Load(); 1713serverOptions.ConfigurationLoader.LoadInternal(); 1730serverOptions.ConfigurationLoader.LocalhostEndpoint(5000 + i, _ => numEndpointsAdded++); 1733serverOptions.ConfigurationLoader.ProcessEndpointsToAdd(); 1743serverOptions.ConfigurationLoader.LocalhostEndpoint(6000 + i, _ => numEndpointsAdded++); 1746serverOptions.ConfigurationLoader.ProcessEndpointsToAdd(); 1761serverOptions.ConfigurationLoader.LocalhostEndpoint(5000, _ => numEndpointsAdded++); 1762serverOptions.ConfigurationLoader.LocalhostEndpoint(5001, _ => throw new InvalidOperationException()); 1763serverOptions.ConfigurationLoader.LocalhostEndpoint(5002, _ => numEndpointsAdded++); 1765Assert.Throws<InvalidOperationException>(serverOptions.ConfigurationLoader.ProcessEndpointsToAdd); 1771serverOptions.ConfigurationLoader.ProcessEndpointsToAdd(); 1786serverOptions.ConfigurationLoader.LocalhostEndpoint(5000); 1788serverOptions.ConfigurationLoader.ProcessEndpointsToAdd(); 1795serverOptions.ConfigurationLoader.LocalhostEndpoint(7000, _ => Assert.Fail("New endpoints should not be added after ProcessEndpointsToAdd")); 1797serverOptions.ConfigurationLoader.Load(); 1810serverOptions.ConfigurationLoader.LocalhostEndpoint(5000); 1812serverOptions.ConfigurationLoader.Load(); 1818serverOptions.ConfigurationLoader.LocalhostEndpoint(7000, _ => Assert.Fail("New endpoints should not be added after Load")); 1821serverOptions.ConfigurationLoader.ProcessEndpointsToAdd(); 1830serverOptions.ConfigurationLoader.LocalhostEndpoint(7000, _ => Assert.Fail("New endpoints should not be added by LoadInternal")); 1832serverOptions.ConfigurationLoader.LoadInternal(); 1841serverOptions.ConfigurationLoader.Load(); 1843serverOptions.ConfigurationLoader.LocalhostEndpoint(7000, _ => Assert.Fail("New endpoints should not be added by Reload")); 1845_ = serverOptions.ConfigurationLoader.Reload(); 1856Assert.Equal(builder, serverOptions.ConfigurationLoader); 1862Assert.NotNull(serverOptions.ConfigurationLoader);