14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureHostBuilder.cs (4)
67
var previousContentRootConfig = _configuration[HostDefaults.
ContentRootKey
];
80
if (!string.Equals(previousContentRootConfig, _configuration[HostDefaults.
ContentRootKey
], StringComparison.OrdinalIgnoreCase)
81
&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[HostDefaults.
ContentRootKey
]), StringComparison.OrdinalIgnoreCase))
83
throw new NotSupportedException($"The content root changed from \"{previousContentRoot}\" to \"{HostingPathResolver.ResolvePath(_configuration[HostDefaults.
ContentRootKey
])}\". Changing the host configuration using WebApplicationBuilder.Host is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
WebApplicationBuilder.cs (2)
244
if (options.ContentRootPath is null && configuration[HostDefaults.
ContentRootKey
] is null)
261
new KeyValuePair<string, string?>(HostDefaults.
ContentRootKey
, cwd),
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1232
{ HostDefaults.
ContentRootKey
, Directory.GetCurrentDirectory() },
Microsoft.Extensions.Hosting (7)
HostApplicationBuilder.cs (4)
91
if (settings.ContentRootPath is null && Configuration[HostDefaults.
ContentRootKey
] is null)
157
optionList.Add(new KeyValuePair<string, string?>(HostDefaults.
ContentRootKey
, settings.ContentRootPath));
278
string? previousContentRootConfig = config[HostDefaults.
ContentRootKey
];
298
string? currentContentRootConfig = config[HostDefaults.
ContentRootKey
];
HostBuilder.cs (1)
232
ContentRootPath = ResolveContentRootPath(hostConfiguration[HostDefaults.
ContentRootKey
], AppContext.BaseDirectory),
HostingHostBuilderExtensions.cs (2)
62
new KeyValuePair<string, string?>(HostDefaults.
ContentRootKey
, contentRoot)
231
new KeyValuePair<string, string?>(HostDefaults.
ContentRootKey
, cwd),