14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureWebHostBuilder.cs (5)
40var previousContentRootConfig = _configuration[WebHostDefaults.ContentRootKey]; 62else if (!string.Equals(previousContentRootConfig, _configuration[WebHostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase) 63&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase)) 66throw 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."); 135else if (string.Equals(key, WebHostDefaults.ContentRootKey, StringComparison.OrdinalIgnoreCase) &&
WebHost.cs (1)
159if (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)
395Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.ContentRootKey, contentRoot)); 433{ WebHostDefaults.ContentRootKey, contentRoot } 841$"--{WebHostDefaults.ContentRootKey}={contentRoot}", 891$"--{WebHostDefaults.ContentRootKey}={contentRoot}", 2252builder.Configuration[WebHostDefaults.ContentRootKey] = contentRoot;