14 references to ContentRootKey
Microsoft.AspNetCore (6)
ConfigureWebHostBuilder.cs (5)
42
var previousContentRootConfig = _configuration[WebHostDefaults.
ContentRootKey
];
64
else if (!string.Equals(previousContentRootConfig, _configuration[WebHostDefaults.
ContentRootKey
], StringComparison.OrdinalIgnoreCase)
65
&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.
ContentRootKey
]), StringComparison.OrdinalIgnoreCase))
68
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.");
137
else if (string.Equals(key, WebHostDefaults.
ContentRootKey
, StringComparison.OrdinalIgnoreCase) &&
WebHost.cs (1)
162
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)
397
Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.
ContentRootKey
, contentRoot));
435
{ WebHostDefaults.
ContentRootKey
, contentRoot }
843
$"--{WebHostDefaults.
ContentRootKey
}={contentRoot}",
893
$"--{WebHostDefaults.
ContentRootKey
}={contentRoot}",
2254
builder.Configuration[WebHostDefaults.
ContentRootKey
] = contentRoot;