17 references to WebRootKey
Microsoft.AspNetCore (8)
ConfigureWebHostBuilder.cs (5)
42
var previousWebRootConfig = _configuration[WebHostDefaults.
WebRootKey
];
51
if (!string.Equals(previousWebRootConfig, _configuration[WebHostDefaults.
WebRootKey
], StringComparison.OrdinalIgnoreCase)
52
&& !string.Equals(HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot), HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.
WebRootKey
], previousContentRoot), StringComparison.OrdinalIgnoreCase))
55
throw new NotSupportedException($"The web root changed from \"{HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot)}\" to \"{HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.
WebRootKey
], previousContentRoot)}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
123
if (string.Equals(key, WebHostDefaults.
WebRootKey
, StringComparison.OrdinalIgnoreCase) &&
WebApplicationBuilder.cs (3)
54
new KeyValuePair<string, string?>(WebHostDefaults.
WebRootKey
, options.WebRootPath),
117
new KeyValuePair<string, string?>(WebHostDefaults.
WebRootKey
, options.WebRootPath),
170
new KeyValuePair<string, string?>(WebHostDefaults.
WebRootKey
, options.WebRootPath),
Microsoft.AspNetCore.Hosting (1)
Internal\WebHostOptions.cs (1)
25
WebRoot = GetConfig(WebHostDefaults.
WebRootKey
);
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
116
return hostBuilder.UseSetting(WebHostDefaults.
WebRootKey
, webRoot);
Microsoft.AspNetCore.Hosting.Tests (2)
HostingEnvironmentExtensionsTests.cs (1)
21
[WebHostDefaults.
WebRootKey
] = "testroot"
WebHostConfigurationsTests.cs (1)
16
{ WebHostDefaults.
WebRootKey
, "wwwroot"},
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
SimpleWithWebApplicationBuilderTests.cs (1)
206
builder.UseSetting(WebHostDefaults.
WebRootKey
, webRoot);
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
396
Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.
WebRootKey
, webRoot));
441
{ WebHostDefaults.
WebRootKey
, webRoot }
842
$"--{WebHostDefaults.
WebRootKey
}=wwwroot2",
893
$"--{WebHostDefaults.
WebRootKey
}={webRoot}",