1 write to _configuration
Microsoft.AspNetCore (1)
ConfigureWebHostBuilder.cs (1)
25
_configuration
= configuration;
27 references to _configuration
Microsoft.AspNetCore (27)
ConfigureWebHostBuilder.cs (27)
42
var previousContentRootConfig =
_configuration
[WebHostDefaults.ContentRootKey];
44
var previousWebRootConfig =
_configuration
[WebHostDefaults.WebRootKey];
45
var previousApplication =
_configuration
[WebHostDefaults.ApplicationKey];
46
var previousEnvironment =
_configuration
[WebHostDefaults.EnvironmentKey];
47
var previousHostingStartupAssemblies =
_configuration
[WebHostDefaults.HostingStartupAssembliesKey];
48
var previousHostingStartupAssembliesExclude =
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey];
51
configureDelegate(_context,
_configuration
);
53
if (!string.Equals(previousWebRootConfig,
_configuration
[WebHostDefaults.WebRootKey], StringComparison.OrdinalIgnoreCase)
54
&& !string.Equals(HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot), HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.WebRootKey], previousContentRoot), StringComparison.OrdinalIgnoreCase))
57
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.");
59
else if (!string.Equals(previousApplication,
_configuration
[WebHostDefaults.ApplicationKey], StringComparison.OrdinalIgnoreCase))
62
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.");
64
else if (!string.Equals(previousContentRootConfig,
_configuration
[WebHostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase)
65
&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(
_configuration
[WebHostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase))
68
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.");
70
else if (!string.Equals(previousEnvironment,
_configuration
[WebHostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase))
73
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.");
75
else if (!string.Equals(previousHostingStartupAssemblies,
_configuration
[WebHostDefaults.HostingStartupAssembliesKey], StringComparison.OrdinalIgnoreCase))
78
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.");
80
else if (!string.Equals(previousHostingStartupAssembliesExclude,
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey], StringComparison.OrdinalIgnoreCase))
83
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.");
106
return
_configuration
[key];
120
var previousApplication =
_configuration
[WebHostDefaults.ApplicationKey];
121
var previousEnvironment =
_configuration
[WebHostDefaults.EnvironmentKey];
122
var previousHostingStartupAssemblies =
_configuration
[WebHostDefaults.HostingStartupAssembliesKey];
123
var previousHostingStartupAssembliesExclude =
_configuration
[WebHostDefaults.HostingStartupExcludeAssembliesKey];
163
_configuration
[key] = value;