14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureWebHostBuilder.cs (5)
42var previousContentRootConfig = _configuration[WebHostDefaults.ContentRootKey]; 64else if (!string.Equals(previousContentRootConfig, _configuration[WebHostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase) 65&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase)) 68throw 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."); 137else if (string.Equals(key, WebHostDefaults.ContentRootKey, StringComparison.OrdinalIgnoreCase) &&
WebHost.cs (1)
162if (string.IsNullOrEmpty(builder.GetSetting(WebHostDefaults.ContentRootKey)))
Microsoft.AspNetCore.Hosting (1)
Internal\WebHostOptions.cs (1)
26ContentRootPath = environment?.ContentRootPath ?? GetConfig(WebHostDefaults.ContentRootKey);
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
103return hostBuilder.UseSetting(WebHostDefaults.ContentRootKey, contentRoot);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
SimpleWithWebApplicationBuilderTests.cs (1)
205expectedWebRoot = Path.GetFullPath(Path.Combine(builder.GetSetting(WebHostDefaults.ContentRootKey), webRoot));
Microsoft.AspNetCore.Tests (5)
WebApplicationTests.cs (5)
397Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.ContentRootKey, contentRoot)); 435{ WebHostDefaults.ContentRootKey, contentRoot } 843$"--{WebHostDefaults.ContentRootKey}={contentRoot}", 893$"--{WebHostDefaults.ContentRootKey}={contentRoot}", 2254builder.Configuration[WebHostDefaults.ContentRootKey] = contentRoot;