1 write to _configuration
Microsoft.AspNetCore (1)
ConfigureWebHostBuilder.cs (1)
25
_configuration
= configuration;
27 references to _configuration
Microsoft.AspNetCore (27)
ConfigureWebHostBuilder.cs (27)
40
var previousContentRootConfig =
_configuration
[WebHostDefaults.ContentRootKey];
42
var previousWebRootConfig =
_configuration
[WebHostDefaults.WebRootKey];
43
var previousApplication =
_configuration
[WebHostDefaults.ApplicationKey];
44
var previousEnvironment =
_configuration
[WebHostDefaults.EnvironmentKey];
45
var previousHostingStartupAssemblies =
_configuration
[WebHostDefaults.HostingStartupAssembliesKey];
46
var previousHostingStartupAssembliesExclude =
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey];
49
configureDelegate(_context,
_configuration
);
51
if (!string.Equals(previousWebRootConfig,
_configuration
[WebHostDefaults.WebRootKey], StringComparison.OrdinalIgnoreCase)
52
&& !string.Equals(HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot), HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.WebRootKey], previousContentRoot), StringComparison.OrdinalIgnoreCase))
55
throw new NotSupportedException($"The web root changed from \"{HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot)}\" to \"{HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.WebRootKey], previousContentRoot)}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
57
else if (!string.Equals(previousApplication,
_configuration
[WebHostDefaults.ApplicationKey], StringComparison.OrdinalIgnoreCase))
60
throw new NotSupportedException($"The application name changed from \"{previousApplication}\" to \"{
_configuration
[WebHostDefaults.ApplicationKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
62
else if (!string.Equals(previousContentRootConfig,
_configuration
[WebHostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase)
63
&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase))
66
throw new NotSupportedException($"The content root changed from \"{previousContentRoot}\" to \"{HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.ContentRootKey])}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
68
else if (!string.Equals(previousEnvironment,
_configuration
[WebHostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase))
71
throw new NotSupportedException($"The environment changed from \"{previousEnvironment}\" to \"{
_configuration
[WebHostDefaults.EnvironmentKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
73
else if (!string.Equals(previousHostingStartupAssemblies,
_configuration
[WebHostDefaults.HostingStartupAssembliesKey], StringComparison.OrdinalIgnoreCase))
76
throw new NotSupportedException($"The hosting startup assemblies changed from \"{previousHostingStartupAssemblies}\" to \"{
_configuration
[WebHostDefaults.HostingStartupAssembliesKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
78
else if (!string.Equals(previousHostingStartupAssembliesExclude,
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey], StringComparison.OrdinalIgnoreCase))
81
throw new NotSupportedException($"The hosting startup assemblies exclude list changed from \"{previousHostingStartupAssembliesExclude}\" to \"{
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
104
return
_configuration
[key];
118
var previousApplication =
_configuration
[WebHostDefaults.ApplicationKey];
119
var previousEnvironment =
_configuration
[WebHostDefaults.EnvironmentKey];
120
var previousHostingStartupAssemblies =
_configuration
[WebHostDefaults.HostingStartupAssembliesKey];
121
var previousHostingStartupAssembliesExclude =
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey];
161
_configuration
[key] = value;