Implemented interface member:
property
this
Microsoft.Extensions.Configuration.IConfiguration.this[System.String]
104 writes to
Aspire.Hosting.Azure.Tests (13)
Aspire.Hosting.Containers.Tests (7)
Aspire.Hosting.Elasticsearch.Tests (5)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.Milvus.Tests (10)
Aspire.Hosting.MongoDB.Tests (5)
Aspire.Hosting.MySql.Tests (2)
Aspire.Hosting.Nats.Tests (7)
Aspire.Hosting.Oracle.Tests (7)
Aspire.Hosting.PostgreSQL.Tests (6)
Aspire.Hosting.Python.Tests (1)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (5)
Aspire.Hosting.Redis.Tests (2)
Aspire.Hosting.SqlServer.Tests (4)
Aspire.Hosting.Tests (9)
Aspire.Playground.Tests (1)
Microsoft.AspNetCore (1)
Microsoft.AspNetCore.StaticAssets.Tests (2)
Microsoft.AspNetCore.Tests (4)
TestProject.AppHost (3)
WithDockerfile.AppHost (1)
84 references to
Aspire.Azure.Security.KeyVault.Tests (2)
Aspire.Dashboard.Tests (3)
Aspire.Hosting (5)
Aspire.Hosting.Azure.Functions (1)
Aspire.Hosting.Tests (4)
Microsoft.AspNetCore (40)
ConfigureWebHostBuilder.cs (25)
40var previousContentRootConfig = _configuration[WebHostDefaults.ContentRootKey];
42var previousWebRootConfig = _configuration[WebHostDefaults.WebRootKey];
43var previousApplication = _configuration[WebHostDefaults.ApplicationKey];
44var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey];
45var previousHostingStartupAssemblies = _configuration[WebHostDefaults.HostingStartupAssembliesKey];
46var previousHostingStartupAssembliesExclude = _configuration[WebHostDefaults.HostingStartupExcludeAssembliesKey];
51if (!string.Equals(previousWebRootConfig, _configuration[WebHostDefaults.WebRootKey], StringComparison.OrdinalIgnoreCase)
52&& !string.Equals(HostingPathResolver.ResolvePath(previousWebRoot, previousContentRoot), HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.WebRootKey], previousContentRoot), StringComparison.OrdinalIgnoreCase))
55throw 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.");
57else if (!string.Equals(previousApplication, _configuration[WebHostDefaults.ApplicationKey], StringComparison.OrdinalIgnoreCase))
60throw new NotSupportedException($"The application name changed from \"{previousApplication}\" to \"{_configuration[WebHostDefaults.ApplicationKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
62else if (!string.Equals(previousContentRootConfig, _configuration[WebHostDefaults.ContentRootKey], StringComparison.OrdinalIgnoreCase)
63&& !string.Equals(previousContentRoot, HostingPathResolver.ResolvePath(_configuration[WebHostDefaults.ContentRootKey]), StringComparison.OrdinalIgnoreCase))
66throw 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.");
68else if (!string.Equals(previousEnvironment, _configuration[WebHostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase))
71throw new NotSupportedException($"The environment changed from \"{previousEnvironment}\" to \"{_configuration[WebHostDefaults.EnvironmentKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
73else if (!string.Equals(previousHostingStartupAssemblies, _configuration[WebHostDefaults.HostingStartupAssembliesKey], StringComparison.OrdinalIgnoreCase))
76throw new NotSupportedException($"The hosting startup assemblies changed from \"{previousHostingStartupAssemblies}\" to \"{_configuration[WebHostDefaults.HostingStartupAssembliesKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
78else if (!string.Equals(previousHostingStartupAssembliesExclude, _configuration[WebHostDefaults.HostingStartupExcludeAssembliesKey], StringComparison.OrdinalIgnoreCase))
81throw new NotSupportedException($"The hosting startup assemblies exclude list changed from \"{previousHostingStartupAssembliesExclude}\" to \"{_configuration[WebHostDefaults.HostingStartupExcludeAssembliesKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
104return _configuration[key];
118var previousApplication = _configuration[WebHostDefaults.ApplicationKey];
119var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey];
120var previousHostingStartupAssemblies = _configuration[WebHostDefaults.HostingStartupAssembliesKey];
121var previousHostingStartupAssembliesExclude = _configuration[WebHostDefaults.HostingStartupExcludeAssembliesKey];
Microsoft.AspNetCore.Tests (19)
WebApplicationTests.cs (19)
176Assert.Equal("http://localhost:5001", builder.Configuration["urls"]);
1029Assert.Equal("command_line_one", builder.Configuration["one"]);
1030Assert.Equal("unprefixed_two", builder.Configuration["two"]);
1031Assert.Equal("DOTNET_three", builder.Configuration["three"]);
1032Assert.Equal("ASPNETCORE_four", builder.Configuration["four"]);
1043Assert.Equal("1", builder.Configuration["x"]);
1044Assert.Equal("Larry", builder.Configuration["name"]);
1045Assert.Equal("20", builder.Configuration["age"]);
1046Assert.Equal("Testing", builder.Configuration["environment"]);
1109Assert.Equal("value", builder.Configuration["A"]);
1110Assert.Equal("another", builder.Configuration["B"]);
1164Assert.Equal("A", builder.Configuration["A"]);
1165Assert.Equal("B", builder.Configuration["B"]);
1166Assert.Equal("C", builder.Configuration["C"]);
1167Assert.Equal("D", builder.Configuration["D"]);
1168Assert.Equal("E", builder.Configuration["E"]);
1169Assert.Equal("F", builder.Configuration["F"]);
1429Assert.Equal("bar", builder.Configuration["foo"]);
1527Assert.Equal("bar", builder.Configuration["foo"]);
Microsoft.Extensions.Hosting (9)
OpenAIEndToEnd.WebStory (1)