14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureWebHostBuilder.cs (5)
40
var previousContentRootConfig = _configuration[WebHostDefaults.
ContentRootKey
];
62
else if (!string.Equals(previousContentRootConfig, _configuration[WebHostDefaults.
ContentRootKey
], StringComparison.OrdinalIgnoreCase)
63
&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.
ContentRootKey
]), StringComparison.OrdinalIgnoreCase))
66
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.");
135
else if (string.Equals(key, WebHostDefaults.
ContentRootKey
, StringComparison.OrdinalIgnoreCase) &&
WebHost.cs (1)
159
if (string.IsNullOrEmpty(builder.GetSetting(WebHostDefaults.
ContentRootKey
)))
Microsoft.AspNetCore.Hosting (1)
Internal\WebHostOptions.cs (1)
26
ContentRootPath = environment?.ContentRootPath ?? GetConfig(WebHostDefaults.
ContentRootKey
);
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
103
return hostBuilder.UseSetting(WebHostDefaults.
ContentRootKey
, contentRoot);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
SimpleWithWebApplicationBuilderTests.cs (1)
205
expectedWebRoot = Path.GetFullPath(Path.Combine(builder.GetSetting(WebHostDefaults.
ContentRootKey
), webRoot));
Microsoft.AspNetCore.Tests (5)
WebApplicationTests.cs (5)
395
Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.
ContentRootKey
, contentRoot));
433
{ WebHostDefaults.
ContentRootKey
, contentRoot }
841
$"--{WebHostDefaults.
ContentRootKey
}={contentRoot}",
891
$"--{WebHostDefaults.
ContentRootKey
}={contentRoot}",
2252
builder.Configuration[WebHostDefaults.
ContentRootKey
] = contentRoot;