Configuration["key"]: @Configuration["key"]
``` In an MVC view: ```cshtml @using Microsoft.Extensions.Configuration @inject IConfiguration ConfigurationConfiguration["key"]: @Configuration["key"]
``` ## Additional notes * Dependency Injection (DI) isn't set up until after `ConfigureServices` is invoked. * The configuration system isn't DI aware. * `IConfiguration` has two specializations: * `IConfigurationRoot` Used for the root node. Can trigger a reload. * `IConfigurationSection` Represents a section of configuration values. The `GetSection` and `GetChildren` methods return an `IConfigurationSection`. * Use [IConfigurationRoot](/dotnet/api/microsoft.extensions.configuration.iconfigurationroot) when reloading configuration or for access to each provider. Neither of these situations are common. ## Additional resources * [Options](xref:fundamentals/configuration/options) * [Working with Multiple Environments](xref:fundamentals/environments) * [Safe storage of app secrets during development](xref:security/app-secrets) * [Hosting in ASP.NET Core](xref:fundamentals/hosting) * [Dependency Injection](xref:fundamentals/dependency-injection) * [Azure Key Vault configuration provider](xref:security/key-vault-configuration)