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