14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureHostBuilder.cs (4)
67var previousContentRootConfig = _configuration[HostDefaults.ContentRootKey]; 80if (!string.Equals(previousContentRootConfig, _configuration[HostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase) 81&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[HostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase)) 83throw 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)
244if (options.ContentRootPath is null && configuration[HostDefaults.ContentRootKey] is null) 261new 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)
91if (settings.ContentRootPath is null && Configuration[HostDefaults.ContentRootKey] is null) 157optionList.Add(new KeyValuePair<string, string?>(HostDefaults.ContentRootKey, settings.ContentRootPath)); 278string? previousContentRootConfig = config[HostDefaults.ContentRootKey]; 298string? currentContentRootConfig = config[HostDefaults.ContentRootKey];
HostBuilder.cs (1)
232ContentRootPath = ResolveContentRootPath(hostConfiguration[HostDefaults.ContentRootKey], AppContext.BaseDirectory),
HostingHostBuilderExtensions.cs (2)
62new KeyValuePair<string, string?>(HostDefaults.ContentRootKey, contentRoot) 231new KeyValuePair<string, string?>(HostDefaults.ContentRootKey, cwd),