4 implementations of
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostConfiguration.cs (1)
44public string? this[string key]
Microsoft.Extensions.Configuration (3)
ConfigurationManager.cs (1)
53public string? this[string key]
ConfigurationRoot.cs (1)
50public string? this[string key]
ConfigurationSection.cs (1)
68public string? this[string key]
38 writes to
Aspire.Hosting.Tests (29)
Dashboard\TransportOptionsValidatorTests.cs (29)
21config[KnownConfigNames.AspNetCoreUrls] = "http://localhost:1234"; 41config[KnownConfigNames.AspNetCoreUrls] = "http://localhost:1234"; 59config[KnownConfigNames.AspNetCoreUrls] = "http://localhost:1234"; 77config[KnownConfigNames.AspNetCoreUrls] = "http://localhost:1234"; 94config[KnownConfigNames.AspNetCoreUrls] = invalidUrl; 133config[KnownConfigNames.AspNetCoreUrls] = string.Empty; 153config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 154config[KnownConfigNames.ResourceServiceEndpointUrl] = string.Empty; 155config[KnownConfigNames.DashboardOtlpGrpcEndpointUrl] = "https://localhost:1236"; 175config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 176config[KnownConfigNames.ResourceServiceEndpointUrl] = "https://localhost:1235"; 177config[KnownConfigNames.DashboardOtlpGrpcEndpointUrl] = string.Empty; 198config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 199config[KnownConfigNames.ResourceServiceEndpointUrl] = invalidUrl; 200config[KnownConfigNames.DashboardOtlpGrpcEndpointUrl] = "https://localhost:1236"; 223config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 224config[KnownConfigNames.ResourceServiceEndpointUrl] = "https://localhost:1235"; 225config[otlpEndpointConfigName] = invalidUrl; 247config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 248config[KnownConfigNames.ResourceServiceEndpointUrl] = "https://localhost:1235"; 249config[otlpEndpointConfigName] = "http://localhost:1236"; 269config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 270config[KnownConfigNames.ResourceServiceEndpointUrl] = "http://localhost:1235"; 271config[KnownConfigNames.DashboardOtlpGrpcEndpointUrl] = "https://localhost:1236"; 291config[KnownConfigNames.AspNetCoreUrls] = "http://localhost:1234"; 307config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 323config[KnownConfigNames.AspNetCoreUrls] = "https://localhost:1234"; 324config[KnownConfigNames.DashboardOtlpHttpEndpointUrl] = "https://localhost:1235"; 325config[KnownConfigNames.ResourceServiceEndpointUrl] = "https://localhost:1236";
Microsoft.AspNetCore.HostFiltering.Tests (2)
HostFilteringMiddlewareTests.cs (2)
228config["AllowedHosts"] = "localhost"; 262config["AllowedHosts"] = "otherHost";
Microsoft.AspNetCore.Hosting (2)
GenericHost\WebHostBuilderBase.cs (1)
104_config[key] = value;
WebHostBuilder.cs (1)
82_config[key] = value;
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (1)
1374config["AllowedHosts"] = "NewHost";
WebHostTests.cs (1)
50config["AllowedHosts"] = "NewHost";
Microsoft.Extensions.Configuration (3)
ChainedConfigurationProvider.cs (1)
52public void Set(string key, string? value) => _config[key] = value;
ConfigurationSection.cs (2)
59_root[Path] = value; 76_root[Path + ConfigurationPath.KeyDelimiter + key] = value;
338 references to
Aspire.Dashboard (5)
DashboardWebApplication.cs (1)
655var address = BindingAddress.Parse(endpointConfiguration.ConfigSection["Url"]!);
src\Shared\IConfigurationExtensions.cs (4)
22var value = configuration[key]; 68var uri = configuration[key]; 98var uris = configuration[key]; 137var value = configuration[key];
Aspire.Hosting (10)
Dcp\DcpNameGenerator.cs (1)
69_ => _configuration["AppHost:Sha256"]!.Substring(0, RandomNameSuffixLength).ToLowerInvariant(),
OtlpConfigurationExtensions.cs (3)
45var dashboardOtlpGrpcUrl = configuration[DashboardOtlpGrpcUrlVariableName]; 46var dashboardOtlpHttpUrl = configuration[DashboardOtlpHttpUrlVariableName]; 79if (configuration["AppHost:OtlpApiKey"] is { } otlpApiKey)
ParameterResourceBuilderExtensions.cs (1)
144return configuration[configurationKey]
ProjectResourceBuilderExtensions.cs (1)
360var isHttp2ConfiguredInKestrelEndpointDefaults = config["Kestrel:EndpointDefaults:Protocols"] == nameof(HttpProtocols.Http2);
src\Shared\IConfigurationExtensions.cs (4)
22var value = configuration[key]; 68var uri = configuration[key]; 98var uris = configuration[key]; 137var value = configuration[key];
Aspire.Hosting.Azure (8)
Provisioning\Provisioners\BicepProvisioner.cs (8)
39var configCheckSum = section["CheckSum"]; 46if (section["Outputs"] is string outputJson) 79if (section["Id"] is string deploymentId && 90new("azure.subscription.id", configuration["Azure:SubscriptionId"]), 92new("azure.tenant.domain", configuration["Azure:Tenant"]), 93new("azure.location", configuration["Azure:Location"]), 94new(CustomResourceKnownProperties.Source, section["Id"]) 439if (section["Parameters"] is not string jsonString)
Aspire.Hosting.Dapr (1)
DaprDistributedApplicationLifecycleHook.cs (1)
37string appHostDirectory = _configuration["AppHost:Directory"] ?? throw new InvalidOperationException("Unable to obtain the application host directory.");
Aspire.Hosting.Testing.Tests (2)
TestingBuilderTests.cs (1)
206var profileName = config["AppHost:DefaultLaunchProfileName"];
TestingFactoryTests.cs (1)
71var profileName = config["AppHost:DefaultLaunchProfileName"];
Aspire.Hosting.Tests (5)
DistributedApplicationBuilderTests.cs (5)
96Assert.Equal(appHostDirectory, config["AppHost:Directory"]); 106Assert.Equal(nameof(ResourceServiceAuthMode.ApiKey), config["AppHost:ResourceService:AuthMode"]); 107Assert.False(string.IsNullOrEmpty(config["AppHost:ResourceService:ApiKey"])); 117Assert.Equal(nameof(ResourceServiceAuthMode.Unsecured), config["AppHost:ResourceService:AuthMode"]); 118Assert.True(string.IsNullOrEmpty(config["AppHost:ResourceService:ApiKey"]));
Benchmarks (1)
Program.cs (1)
34var scenario = config["scenarios"]?.ToLowerInvariant();
blazor-devserver (1)
Server\Startup.cs (1)
66var manifest = configuration["staticAssets"]!;
CreateDefaultBuilderApp (5)
Program.cs (5)
26&& !string.Equals("KestrelEndPointSettingValue", endpointOptions.ConfigSection["KestrelEndPointSettingName"])) 49if (!string.Equals("settingsValue", context.Configuration["settingsKey"], StringComparison.Ordinal)) 55if (!string.Equals("devSettingsValue", context.Configuration["devSettingsKey"], StringComparison.Ordinal)) 63if (!string.Equals("envValue", context.Configuration["envKey"], StringComparison.Ordinal)) 69if (!string.Equals("cliValue", context.Configuration["cliKey"], StringComparison.Ordinal))
CreateDefaultBuilderOfTApp (5)
Program.cs (5)
29&& !string.Equals("KestrelEndPointSettingValue", endpointOptions.ConfigSection["KestrelEndPointSettingName"])) 61if (!string.Equals("settingsValue", context.Configuration["settingsKey"], StringComparison.Ordinal)) 67if (!string.Equals("devSettingsValue", context.Configuration["devSettingsKey"], StringComparison.Ordinal)) 75if (!string.Equals("envValue", context.Configuration["envKey"], StringComparison.Ordinal)) 81if (!string.Equals("cliValue", context.Configuration["cliKey"], StringComparison.Ordinal))
HealthChecksSample (5)
DbContextHealthStartup.cs (1)
33options => options.UseSqlite(Configuration["ConnectionStrings:DefaultConnection"]));
DBHealthStartup.cs (1)
21.AddCheck("MyDatabase", new SqlConnectionHealthCheck(Configuration["ConnectionStrings:DefaultConnection"]));
ManagementPortStartup.cs (2)
36app.UseHealthChecks("/health", port: Configuration["ManagementPort"]); 40await context.Response.WriteAsync($"Go to http://localhost:{Configuration["ManagementPort"]}/health to see the health status");
Program.cs (1)
38var scenario = config["scenario"] ?? string.Empty;
HostFilteringSample (1)
Startup.cs (1)
31var hosts = Config["AllowedHosts"]?.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
InProcessWebSite (9)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (9)
75await ctx.Response.WriteAsync("IIS Version: " + config["IIS_VERSION"] + Environment.NewLine); 76await ctx.Response.WriteAsync("ApplicationId: " + config["IIS_APPLICATION_ID"] + Environment.NewLine); 77await ctx.Response.WriteAsync("Application Path: " + config["IIS_PHYSICAL_PATH"] + Environment.NewLine); 78await ctx.Response.WriteAsync("Application Virtual Path: " + config["IIS_APPLICATION_VIRTUAL_PATH"] + Environment.NewLine); 79await ctx.Response.WriteAsync("Application Config Path: " + config["IIS_APP_CONFIG_PATH"] + Environment.NewLine); 80await ctx.Response.WriteAsync("AppPool ID: " + config["IIS_APP_POOL_ID"] + Environment.NewLine); 81await ctx.Response.WriteAsync("AppPool Config File: " + config["IIS_APP_POOL_CONFIG_FILE"] + Environment.NewLine); 82await ctx.Response.WriteAsync("Site ID: " + config["IIS_SITE_ID"] + Environment.NewLine); 83await ctx.Response.WriteAsync("Site Name: " + config["IIS_SITE_NAME"]);
JwtBearerSample (2)
Startup.cs (2)
32o.Authority = Configuration["oidc:authority"]; 33o.Audience = Configuration["oidc:clientid"];
Microsoft.AspNetCore (3)
ForwardedHeadersOptionsSetup.cs (1)
22if (!string.Equals("true", _configuration["ForwardedHeaders_Enabled"], StringComparison.OrdinalIgnoreCase))
ForwardedHeadersStartupFilter.cs (1)
21if (!string.Equals("true", _configuration["ForwardedHeaders_Enabled"], StringComparison.OrdinalIgnoreCase))
WebHost.cs (1)
259var hosts = hostingContext.Configuration["AllowedHosts"]?.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
Microsoft.AspNetCore.Authentication.JwtBearer (22)
JwtBearerConfigureOptions.cs (22)
43var validateIssuer = StringHelpers.ParseValueOrDefault(configSection[nameof(TokenValidationParameters.ValidateIssuer)], bool.Parse, options.TokenValidationParameters.ValidateIssuer); 44var issuer = configSection[nameof(TokenValidationParameters.ValidIssuer)]; 46var validateAudience = StringHelpers.ParseValueOrDefault(configSection[nameof(TokenValidationParameters.ValidateAudience)], bool.Parse, options.TokenValidationParameters.ValidateAudience); 47var audience = configSection[nameof(TokenValidationParameters.ValidAudience)]; 50options.Authority = configSection[nameof(options.Authority)] ?? options.Authority; 51options.BackchannelTimeout = StringHelpers.ParseValueOrDefault(configSection[nameof(options.BackchannelTimeout)], _invariantTimeSpanParse, options.BackchannelTimeout); 52options.Challenge = configSection[nameof(options.Challenge)] ?? options.Challenge; 53options.ForwardAuthenticate = configSection[nameof(options.ForwardAuthenticate)] ?? options.ForwardAuthenticate; 54options.ForwardChallenge = configSection[nameof(options.ForwardChallenge)] ?? options.ForwardChallenge; 55options.ForwardDefault = configSection[nameof(options.ForwardDefault)] ?? options.ForwardDefault; 56options.ForwardForbid = configSection[nameof(options.ForwardForbid)] ?? options.ForwardForbid; 57options.ForwardSignIn = configSection[nameof(options.ForwardSignIn)] ?? options.ForwardSignIn; 58options.ForwardSignOut = configSection[nameof(options.ForwardSignOut)] ?? options.ForwardSignOut; 59options.IncludeErrorDetails = StringHelpers.ParseValueOrDefault(configSection[nameof(options.IncludeErrorDetails)], bool.Parse, options.IncludeErrorDetails); 60options.MapInboundClaims = StringHelpers.ParseValueOrDefault( configSection[nameof(options.MapInboundClaims)], bool.Parse, options.MapInboundClaims); 61options.MetadataAddress = configSection[nameof(options.MetadataAddress)] ?? options.MetadataAddress; 62options.RefreshInterval = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RefreshInterval)], _invariantTimeSpanParse, options.RefreshInterval); 63options.RefreshOnIssuerKeyNotFound = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RefreshOnIssuerKeyNotFound)], bool.Parse, options.RefreshOnIssuerKeyNotFound); 64options.RequireHttpsMetadata = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RequireHttpsMetadata)], bool.Parse, options.RequireHttpsMetadata); 65options.SaveToken = StringHelpers.ParseValueOrDefault(configSection[nameof(options.SaveToken)], bool.Parse, options.SaveToken); 85.SingleOrDefault(key => key["Issuer"] == issuer); 86if (signingKey is not null && signingKey["Value"] is string keyValue)
Microsoft.AspNetCore.Authentication.OpenIdConnect (46)
OpenIdConnectConfigureOptions.cs (46)
43options.AccessDeniedPath = new PathString(configSection[nameof(options.AccessDeniedPath)] ?? options.AccessDeniedPath.Value); 44options.Authority = configSection[nameof(options.Authority)] ?? options.Authority; 45options.AutomaticRefreshInterval = StringHelpers.ParseValueOrDefault(configSection[nameof(options.AutomaticRefreshInterval)], _invariantTimeSpanParse, options.AutomaticRefreshInterval); 46options.BackchannelTimeout = StringHelpers.ParseValueOrDefault(configSection[nameof(options.BackchannelTimeout)], _invariantTimeSpanParse, options.BackchannelTimeout); 47options.CallbackPath = new PathString(configSection[nameof(options.CallbackPath)] ?? options.CallbackPath.Value); 48options.ClaimsIssuer = configSection[nameof(options.ClaimsIssuer)] ?? options.ClaimsIssuer; 49options.ClientId = configSection[nameof(options.ClientId)] ?? options.ClientId; 50options.ClientSecret = configSection[nameof(options.ClientSecret)] ?? options.ClientSecret; 52options.DisableTelemetry = StringHelpers.ParseValueOrDefault(configSection[nameof(options.DisableTelemetry)], bool.Parse, options.DisableTelemetry); 53options.ForwardAuthenticate = configSection[nameof(options.ForwardAuthenticate)] ?? options.ForwardAuthenticate; 54options.ForwardChallenge = configSection[nameof(options.ForwardChallenge)] ?? options.ForwardChallenge; 55options.ForwardDefault = configSection[nameof(options.ForwardDefault)] ?? options.ForwardDefault; 56options.ForwardForbid = configSection[nameof(options.ForwardForbid)] ?? options.ForwardForbid; 57options.ForwardSignIn = configSection[nameof(options.ForwardSignIn)] ?? options.ForwardSignIn; 58options.ForwardSignOut = configSection[nameof(options.ForwardSignOut)] ?? options.ForwardSignOut; 59options.GetClaimsFromUserInfoEndpoint = StringHelpers.ParseValueOrDefault(configSection[nameof(options.GetClaimsFromUserInfoEndpoint)], bool.Parse, options.GetClaimsFromUserInfoEndpoint); 60options.MapInboundClaims = StringHelpers.ParseValueOrDefault(configSection[nameof(options.MapInboundClaims)], bool.Parse, options.MapInboundClaims); 61options.MaxAge = StringHelpers.ParseValueOrDefault(configSection[nameof(options.MaxAge)], _invariantNullableTimeSpanParse, options.MaxAge); 62options.MetadataAddress = configSection[nameof(options.MetadataAddress)] ?? options.MetadataAddress; 64options.Prompt = configSection[nameof(options.Prompt)] ?? options.Prompt; 65options.RefreshInterval = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RefreshInterval)], _invariantTimeSpanParse, options.RefreshInterval); 66options.RefreshOnIssuerKeyNotFound = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RefreshOnIssuerKeyNotFound)], bool.Parse, options.RefreshOnIssuerKeyNotFound); 67options.RemoteAuthenticationTimeout = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RemoteAuthenticationTimeout)], _invariantTimeSpanParse, options.RemoteAuthenticationTimeout); 68options.RemoteSignOutPath = new PathString(configSection[nameof(options.RemoteSignOutPath)] ?? options.RemoteSignOutPath.Value); 69options.RequireHttpsMetadata = StringHelpers.ParseValueOrDefault(configSection[nameof(options.RequireHttpsMetadata)], bool.Parse, options.RequireHttpsMetadata); 70options.Resource = configSection[nameof(options.Resource)] ?? options.Resource; 71options.ResponseMode = configSection[nameof(options.ResponseMode)] ?? options.ResponseMode; 72options.ResponseType = configSection[nameof(options.ResponseType)] ?? options.ResponseType; 73options.ReturnUrlParameter = configSection[nameof(options.ReturnUrlParameter)] ?? options.ReturnUrlParameter; 74options.SaveTokens = StringHelpers.ParseValueOrDefault(configSection[nameof(options.SaveTokens)], bool.Parse, options.SaveTokens); 76options.SignedOutCallbackPath = new PathString(configSection[nameof(options.SignedOutCallbackPath)] ?? options.SignedOutCallbackPath.Value); 77options.SignedOutRedirectUri = configSection[nameof(options.SignedOutRedirectUri)] ?? options.SignedOutRedirectUri; 78options.SignInScheme = configSection[nameof(options.SignInScheme)] ?? options.SignInScheme; 79options.SignOutScheme = configSection[nameof(options.SignOutScheme)] ?? options.SignOutScheme; 80options.SkipUnrecognizedRequests = StringHelpers.ParseValueOrDefault(configSection[nameof(options.SkipUnrecognizedRequests)], bool.Parse, options.SkipUnrecognizedRequests); 81options.UsePkce = StringHelpers.ParseValueOrDefault(configSection[nameof(options.UsePkce)], bool.Parse, options.UsePkce); 82options.UseTokenLifetime = StringHelpers.ParseValueOrDefault(configSection[nameof(options.UseTokenLifetime)], bool.Parse, options.UseTokenLifetime); 94cookieBuilder.Domain = cookieConfigSection[nameof(cookieBuilder.Domain)] ?? cookieBuilder.Domain; 95cookieBuilder.HttpOnly = StringHelpers.ParseValueOrDefault(cookieConfigSection[nameof(cookieBuilder.HttpOnly)], bool.Parse, cookieBuilder.HttpOnly); 96cookieBuilder.IsEssential = StringHelpers.ParseValueOrDefault(cookieConfigSection[nameof(cookieBuilder.IsEssential)], bool.Parse, cookieBuilder.IsEssential); 97cookieBuilder.Expiration = StringHelpers.ParseValueOrDefault(cookieConfigSection[nameof(cookieBuilder.Expiration)], _invariantNullableTimeSpanParse, cookieBuilder.Expiration); 98cookieBuilder.MaxAge = StringHelpers.ParseValueOrDefault<TimeSpan?>(cookieConfigSection[nameof(cookieBuilder.MaxAge)], _invariantNullableTimeSpanParse, cookieBuilder.MaxAge); 99cookieBuilder.Name = cookieConfigSection[nameof(CookieBuilder.Name)] ?? cookieBuilder.Name; 100cookieBuilder.Path = cookieConfigSection[nameof(CookieBuilder.Path)] ?? cookieBuilder.Path; 101cookieBuilder.SameSite = cookieConfigSection[nameof(CookieBuilder.SameSite)] is string sameSiteMode 104cookieBuilder.SecurePolicy = cookieConfigSection[nameof(CookieBuilder.SecurePolicy)] is string securePolicy
Microsoft.AspNetCore.AzureAppServices.HostingStartup (1)
HostingStartupConfigurationExtensions.cs (1)
30value = configuration[$"HostingStartup:{hostingStartupName}:{featureName}"];
Microsoft.AspNetCore.Components.Server (1)
Circuits\CircuitOptionsJSInteropDetailedErrorsConfiguration.cs (1)
21var value = Configuration[WebHostDefaults.DetailedErrorsKey];
Microsoft.AspNetCore.Components.WebAssembly.Tests (2)
Hosting\WebAssemblyHostBuilderTest.cs (2)
32Assert.Equal("value", host.Configuration["key"]); 203Assert.Equal("value", configuration["key"]);
Microsoft.AspNetCore.DataProtection (1)
Internal\KeyManagementOptionsPostSetup.cs (1)
43var dirPath = configuration[ReadOnlyDataProtectionKeyDirectoryKey];
Microsoft.AspNetCore.HostFiltering.Tests (1)
HostFilteringMiddlewareTests.cs (1)
240options.AllowedHosts = new[] { config["AllowedHosts"] };
Microsoft.AspNetCore.Hosting (11)
GenericHost\GenericWebHostService.cs (4)
71var urls = Configuration[WebHostDefaults.ServerUrlsKey]; 79var httpPorts = Configuration[WebHostDefaults.HttpPortsKey] ?? string.Empty; 80var httpsPorts = Configuration[WebHostDefaults.HttpsPortsKey] ?? string.Empty; 103var preferHostingUrlsConfig = Configuration[WebHostDefaults.PreferHostingUrlsKey];
GenericHost\WebHostBuilderBase.cs (1)
99return _config[key];
Internal\WebHost.cs (3)
265var urls = _config[WebHostDefaults.ServerUrlsKey] ?? _config[DeprecatedServerUrlsKey]; 268serverAddressesFeature!.PreferHostingUrls = WebHostUtilities.ParseBool(_config[WebHostDefaults.PreferHostingUrlsKey]);
Internal\WebHostOptions.cs (1)
18string? GetConfig(string key) => primaryConfiguration[key] ?? fallbackConfiguration?[key];
StaticWebAssets\StaticWebAssetsLoader.cs (1)
50var candidate = configuration[WebHostDefaults.StaticWebAssetsKey] ?? ResolveRelativeToAssembly(environment);
WebHostBuilder.cs (1)
71return _config[key];
Microsoft.AspNetCore.Hosting.Tests (13)
GenericWebHostBuilderTests.cs (2)
26Assert.Equal("true", config[randomEnvKey]); 39Assert.Null(config[randomEnvKey]);
WebHostBuilderTests.cs (11)
331Assert.Equal("value1", context.Configuration["key1"]); 351Assert.Equal("value1", context.Configuration["key1"]); 382Assert.Equal("value1", config["key1"]); 412Assert.Equal("value1", config["key1"]); 1093Assert.Equal("value", configuration["testhostingstartup:config"]); 1113Assert.Equal("appvalue", context.Configuration["appconfig"]); 1117Assert.Equal("appvalue", context.Configuration["appconfig"]); 1121Assert.Equal("appvalue", context.Configuration["appconfig"]); 1129Assert.Equal("appvalue", configuration["appconfig"]); 1137Assert.Equal("value", config["testhostingstartup:config"]); 1338Assert.Equal("nestedvalue", appConfig["key"]);
Microsoft.AspNetCore.Hosting.TestSites (2)
Program.cs (2)
36if (config["STARTMECHANIC"] == "Run") 42else if (config["STARTMECHANIC"] == "WaitForShutdown")
Microsoft.AspNetCore.HttpsPolicy (1)
HttpsRedirectionMiddleware.cs (1)
171int.TryParse(_config[name], NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture, out var value) ? value : null;
Microsoft.AspNetCore.Routing.FunctionalTests (2)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
29var startupName = configuration["Startup"];
Benchmarks\RouterBenchmarkTest.cs (1)
30var startupName = configuration["Startup"];
Microsoft.AspNetCore.Server.IIS (9)
Core\IISEnvironmentFeature.cs (9)
27if (Version.TryParse(configuration["IIS_VERSION"], out var version)) 32if (uint.TryParse(configuration["IIS_SITE_ID"], out var siteId)) 37AppPoolId = configuration["IIS_APP_POOL_ID"] ?? string.Empty; 38AppPoolConfigFile = configuration["IIS_APP_POOL_CONFIG_FILE"] ?? string.Empty; 39AppConfigPath = configuration["IIS_APP_CONFIG_PATH"] ?? string.Empty; 40ApplicationPhysicalPath = configuration["IIS_PHYSICAL_PATH"] ?? string.Empty; 41ApplicationVirtualPath = configuration["IIS_APPLICATION_VIRTUAL_PATH"] ?? string.Empty; 42ApplicationId = configuration["IIS_APPLICATION_ID"] ?? string.Empty; 43SiteName = configuration["IIS_SITE_NAME"] ?? string.Empty;
Microsoft.AspNetCore.Server.IISIntegration.Tests (3)
IISMiddlewareTests.cs (3)
322Assert.Equal("http://127.0.0.1:12345", configuration[WebHostDefaults.ServerUrlsKey]); 323Assert.Equal("true", configuration[WebHostDefaults.PreferHostingUrlsKey]); 350Assert.Equal("http://127.0.0.1:12345", configuration[WebHostDefaults.ServerUrlsKey]);
Microsoft.AspNetCore.Server.Kestrel.Core (14)
Internal\ConfigurationReader.cs (14)
62Protocols = ParseProtocols(configSection[ProtocolsKey]), 64ClientCertificateMode = ParseClientCertificateMode(configSection[ClientCertificateModeKey]), 97var url = endpointConfig[UrlKey]; 109Protocols = ParseProtocols(endpointConfig[ProtocolsKey]), 111ClientCertificateMode = ParseClientCertificateMode(endpointConfig[ClientCertificateModeKey]), 155Protocols = ParseProtocols(sniChild[ProtocolsKey]), 157ClientCertificateMode = ParseClientCertificateMode(sniChild[ClientCertificateModeKey]) 371Path = configSection[nameof(Path)]; 372KeyPath = configSection[nameof(KeyPath)]; 373Password = configSection[nameof(Password)]; 374Subject = configSection[nameof(Subject)]; 375Store = configSection[nameof(Store)]; 376Location = configSection[nameof(Location)]; 378if (bool.TryParse(configSection[nameof(AllowInvalid)], out var value))
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
246return bool.TryParse(config[key], out var value) && value;
Microsoft.AspNetCore.Tests (27)
WebApplicationTests.cs (27)
1065Assert.Equal("1", app.Configuration["x"]); 1066Assert.Equal("Larry", app.Configuration["name"]); 1067Assert.Equal("20", app.Configuration["age"]); 1068Assert.Equal("Testing", app.Configuration["environment"]); 1106Assert.Equal("value", app.Configuration["A"]); 1107Assert.Equal("another", app.Configuration["B"]); 1157Assert.Equal("A", app.Configuration["A"]); 1158Assert.Equal("B", app.Configuration["B"]); 1159Assert.Equal("C", app.Configuration["C"]); 1160Assert.Equal("D", app.Configuration["D"]); 1161Assert.Equal("E", app.Configuration["E"]); 1162Assert.Equal("F", app.Configuration["F"]); 1208Assert.True(string.IsNullOrEmpty(app.Configuration["A"])); 1209Assert.True(string.IsNullOrEmpty(app.Configuration["C"])); 1211Assert.Equal("B", app.Configuration["B"]); 1252Assert.True(string.IsNullOrEmpty(app.Configuration["B"])); 1254Assert.Equal("A", app.Configuration["A"]); 1279Assert.Equal("A", app.Configuration["A"]); 1280Assert.Equal("B", app.Configuration["B"]); 1433Assert.Equal("bar", app.Configuration["foo"]); 1535Assert.Equal("bar", config["foo"]); 1540Assert.Equal("bar", app.Configuration["foo"]); 2101Assert.Equal("value", app.Configuration["testhostingstartup:config"]); 2111Assert.Equal("value", app.Configuration["testhostingstartup:config"]); 2126Assert.Equal("value", app.Configuration["testhostingstartup:config"]); 2328var value0 = app.Configuration["Random"]; 2330var value1 = app.Configuration["Random"];
Microsoft.Extensions.Caching.SqlServer.Tests (3)
SqlServerCacheWithDatabaseTest.cs (3)
51_tableName = configuration[TableNameKey]; 52_schemaName = configuration[SchemaNameKey]; 53_connectionString = configuration[ConnectionStringKey];
Microsoft.Extensions.Configuration (3)
ChainedConfigurationProvider.cs (1)
43value = _config[key];
ConfigurationSection.cs (2)
55return _root[Path]; 72return _root[Path + ConfigurationPath.KeyDelimiter + key];
Microsoft.Extensions.Configuration.KeyPerFile.Tests (62)
ConfigurationProviderTestBase.cs (25)
199Assert.Equal(value1, config["Key1"], StringComparer.InvariantCultureIgnoreCase); 200Assert.Equal(value12, config["Section1:Key2"], StringComparer.InvariantCultureIgnoreCase); 201Assert.Equal(value123, config["Section1:Section2:Key3"], StringComparer.InvariantCultureIgnoreCase); 202Assert.Equal(arrayvalue0, config["Section1:Section2:Key3a:0"], StringComparer.InvariantCultureIgnoreCase); 203Assert.Equal(arrayvalue1, config["Section1:Section2:Key3a:1"], StringComparer.InvariantCultureIgnoreCase); 204Assert.Equal(arrayvalue2, config["Section1:Section2:Key3a:2"], StringComparer.InvariantCultureIgnoreCase); 205Assert.Equal(value344, config["Section3:Section4:Key4"], StringComparer.InvariantCultureIgnoreCase); 208Assert.Equal(value12, section1["Key2"], StringComparer.InvariantCultureIgnoreCase); 209Assert.Equal(value123, section1["Section2:Key3"], StringComparer.InvariantCultureIgnoreCase); 210Assert.Equal(arrayvalue0, section1["Section2:Key3a:0"], StringComparer.InvariantCultureIgnoreCase); 211Assert.Equal(arrayvalue1, section1["Section2:Key3a:1"], StringComparer.InvariantCultureIgnoreCase); 212Assert.Equal(arrayvalue2, section1["Section2:Key3a:2"], StringComparer.InvariantCultureIgnoreCase); 217Assert.Equal(value123, section2["Key3"], StringComparer.InvariantCultureIgnoreCase); 218Assert.Equal(arrayvalue0, section2["Key3a:0"], StringComparer.InvariantCultureIgnoreCase); 219Assert.Equal(arrayvalue1, section2["Key3a:1"], StringComparer.InvariantCultureIgnoreCase); 220Assert.Equal(arrayvalue2, section2["Key3a:2"], StringComparer.InvariantCultureIgnoreCase); 225Assert.Equal(value123, section2["Key3"], StringComparer.InvariantCultureIgnoreCase); 226Assert.Equal(arrayvalue0, section2["Key3a:0"], StringComparer.InvariantCultureIgnoreCase); 227Assert.Equal(arrayvalue1, section2["Key3a:1"], StringComparer.InvariantCultureIgnoreCase); 228Assert.Equal(arrayvalue2, section2["Key3a:2"], StringComparer.InvariantCultureIgnoreCase); 233Assert.Equal(arrayvalue0, section3a["0"], StringComparer.InvariantCultureIgnoreCase); 234Assert.Equal(arrayvalue1, section3a["1"], StringComparer.InvariantCultureIgnoreCase); 235Assert.Equal(arrayvalue2, section3a["2"], StringComparer.InvariantCultureIgnoreCase); 244Assert.Equal(value344, section4["Key4"], StringComparer.InvariantCultureIgnoreCase); 249Assert.Equal(value344, section4["Key4"], StringComparer.InvariantCultureIgnoreCase);
KeyPerFileTests.cs (37)
50Assert.Equal("SecretValue1", config["Secret1"]); 51Assert.Equal("SecretValue2", config["Secret2"]); 66Assert.Equal("SecretValue1", config["Secret1"]); 67Assert.Equal("SecretValue2", config["Secret2"]); 82Assert.Equal("SecretValue0", config["Secret0:Key"]); 83Assert.Equal("SecretValue1", config["Secret0:Secret1:Key"]); 84Assert.Equal("SecretValue2", config["Secret0:Secret1:Secret2:Key"]); 103Assert.Equal("SecretValue0", config["Secret0:Key"]); 104Assert.Equal("SecretValue1", config["Secret0:Secret1:Key"]); 105Assert.Equal("SecretValue2", config["Secret0:Secret1:Secret2:Key"]); 120Assert.Null(config["ignore.Secret0"]); 121Assert.Null(config["ignore.Secret1"]); 122Assert.Equal("SecretValue2", config["Secret2"]); 141Assert.Equal("SecretValue0", config["ignore.Secret0"]); 142Assert.Equal("SecretValue1", config["ignore.Secret1"]); 143Assert.Equal("SecretValue2", config["Secret2"]); 181Assert.Null(config["meSecret0"]); 182Assert.Null(config["meSecret1"]); 183Assert.Equal("SecretValue2", config["Secret2"]); 202Assert.Equal("SecretValue0", config["ignore.Secret0"]); 203Assert.Equal("SecretValue1", config["ignore.Secret1"]); 204Assert.Equal("SecretValue2", config["Secret2"]); 256Assert.Equal("SecretValue1", config["Secret1"]); 257Assert.Equal("SecretValue2", config["Secret2"]); 263Assert.Equal("NewSecretValue1", config["Secret1"]); 264Assert.Null(config["NewSecret2"]); 265Assert.Equal("NewSecretValue3", config["Secret3"]); 282Assert.Equal("SecretValue1", config["Secret1"]); 283Assert.Equal("SecretValue2", config["Secret2"]); 289Assert.Equal("SecretValue1", config["Secret1"]); 290Assert.Equal("SecretValue2", config["Secret2"]); 312Assert.Equal("SecretValue1", config["Secret1"]); 313Assert.Equal("SecretValue2", config["Secret2"]); 341Assert.Equal("NewSecretValue1", config["Secret1"]); 342Assert.Null(config["NewSecret2"]); 343Assert.Equal("NewSecretValue3", config["Secret3"]); 394Assert.Equal("SecretValue1", config["Secret1"]);
Microsoft.Extensions.Hosting (7)
HostBuilder.cs (3)
231EnvironmentName = hostConfiguration[HostDefaults.EnvironmentKey] ?? Environments.Production, 232ContentRootPath = ResolveContentRootPath(hostConfiguration[HostDefaults.ContentRootKey], AppContext.BaseDirectory), 235string? applicationName = hostConfiguration[HostDefaults.ApplicationKey];
HostOptions.cs (4)
64var timeoutSeconds = configuration["shutdownTimeoutSeconds"]; 71timeoutSeconds = configuration["startupTimeoutSeconds"]; 78var servicesStartConcurrently = configuration["servicesStartConcurrently"]; 85var servicesStopConcurrently = configuration["servicesStopConcurrently"];
Microsoft.Extensions.Http (19)
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (19)
195PooledConnectionIdleTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.PooledConnectionIdleTimeout)]), 196PooledConnectionLifetime = ParseTimeSpan(config[nameof(SocketsHttpHandler.PooledConnectionLifetime)]), 197PreAuthenticate = ParseBool(config[nameof(SocketsHttpHandler.PreAuthenticate)]), 198ResponseDrainTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.ResponseDrainTimeout)]), 199UseCookies = ParseBool(config[nameof(SocketsHttpHandler.UseCookies)]), 200UseProxy = ParseBool(config[nameof(SocketsHttpHandler.UseProxy)]), 201EnableMultipleHttp2Connections = ParseBool(config[nameof(SocketsHttpHandler.EnableMultipleHttp2Connections)]), 202MaxResponseHeadersLength = ParseInt(config[nameof(SocketsHttpHandler.MaxResponseHeadersLength)]), 203MaxResponseDrainSize = ParseInt(config[nameof(SocketsHttpHandler.MaxResponseDrainSize)]), 204MaxConnectionsPerServer = ParseInt(config[nameof(SocketsHttpHandler.MaxConnectionsPerServer)]), 205MaxAutomaticRedirections = ParseInt(config[nameof(SocketsHttpHandler.MaxAutomaticRedirections)]), 206InitialHttp2StreamWindowSize = ParseInt(config[nameof(SocketsHttpHandler.InitialHttp2StreamWindowSize)]), 207AllowAutoRedirect = ParseBool(config[nameof(SocketsHttpHandler.AllowAutoRedirect)]), 208AutomaticDecompression = ParseEnum<DecompressionMethods>(config[nameof(SocketsHttpHandler.AutomaticDecompression)]), 209ConnectTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.ConnectTimeout)]), 210Expect100ContinueTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.Expect100ContinueTimeout)]), 211KeepAlivePingDelay = ParseTimeSpan(config[nameof(SocketsHttpHandler.KeepAlivePingDelay)]), 212KeepAlivePingTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.KeepAlivePingTimeout)]), 213KeepAlivePingPolicy = ParseEnum<HttpKeepAlivePingPolicy>(config[nameof(SocketsHttpHandler.KeepAlivePingPolicy)])
Microsoft.Extensions.Logging.Console (2)
ConfigurationConsoleLoggerSettings.cs (2)
43var value = _configuration["IncludeScopes"]; 86var value = switches[name];
Negotiate.Server (2)
Program.cs (1)
30if (string.Equals("true", context.Configuration["Persist"]))
Startup.cs (1)
28var persist = string.Equals("true", Configuration["Persist"]);
OrderProcessor (1)
OrderProcessingWorker.cs (1)
29string queueName = _config[configKeyName] ?? "orders";
OrleansServiceDefaults (1)
Extensions.cs (1)
70var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
Playground.ServiceDefaults (1)
Extensions.cs (1)
67var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
Seq.ServiceDefaults (1)
Extensions.cs (1)
69var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
SimpleWebSiteWithWebApplicationBuilder (1)
Program.cs (1)
45app.MapGet("/greeting", (IConfiguration config) => config["Greeting"]);
SocialSample (13)
Startup.cs (13)
34if (string.IsNullOrEmpty(Configuration["facebook:appid"])) 48o.AppId = Configuration["facebook:appid"]; 49o.AppSecret = Configuration["facebook:appsecret"]; 65o.ClientId = Configuration["google:clientid"]; 66o.ClientSecret = Configuration["google:clientsecret"]; 82o.ConsumerKey = Configuration["twitter:consumerkey"]; 83o.ConsumerSecret = Configuration["twitter:consumersecret"]; 103o.ClientId = Configuration["microsoftaccount:clientid"]; 104o.ClientSecret = Configuration["microsoftaccount:clientsecret"]; 117o.ClientId = Configuration["github:clientid"]; 118o.ClientSecret = Configuration["github:clientsecret"]; 156o.ClientId = Configuration["github-token:clientid"]; 157o.ClientSecret = Configuration["github-token:clientsecret"];
TestingAppHost1.ServiceDefaults (1)
Extensions.cs (1)
76var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);
TestShop.ServiceDefaults (1)
Extensions.cs (1)
66var useOtlpExporter = !string.IsNullOrWhiteSpace(builder.Configuration["OTEL_EXPORTER_OTLP_ENDPOINT"]);