38 references to HostDefaults
Microsoft.AspNetCore (12)
Microsoft.AspNetCore.Mvc.Testing (1)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
Microsoft.AspNetCore.Tests (4)
Microsoft.Extensions.Hosting (19)
HostApplicationBuilder.cs (12)
93if (settings.ContentRootPath is null && Configuration[HostDefaults.ContentRootKey] is null)
149optionList.Add(new KeyValuePair<string, string?>(HostDefaults.ApplicationKey, settings.ApplicationName));
154optionList.Add(new KeyValuePair<string, string?>(HostDefaults.EnvironmentKey, settings.EnvironmentName));
159optionList.Add(new KeyValuePair<string, string?>(HostDefaults.ContentRootKey, settings.ContentRootPath));
278string? previousApplicationName = config[HostDefaults.ApplicationKey];
279string? previousEnvironment = config[HostDefaults.EnvironmentKey];
280string? previousContentRootConfig = config[HostDefaults.ContentRootKey];
290if (!string.Equals(previousApplicationName, config[HostDefaults.ApplicationKey], StringComparison.OrdinalIgnoreCase))
292throw new NotSupportedException(SR.Format(SR.ApplicationNameChangeNotSupported, previousApplicationName, config[HostDefaults.ApplicationKey]));
294if (!string.Equals(previousEnvironment, config[HostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase))
296throw new NotSupportedException(SR.Format(SR.EnvironmentNameChangeNotSupoprted, previousEnvironment, config[HostDefaults.EnvironmentKey]));
300string? currentContentRootConfig = config[HostDefaults.ContentRootKey];
Microsoft.Extensions.Validation.GeneratorTests (1)