diff --git a/aspnetcore/fundamentals/hosting.md b/aspnetcore/fundamentals/hosting.md index 76a1042114..79b443ea65 100644 --- a/aspnetcore/fundamentals/hosting.md +++ b/aspnetcore/fundamentals/hosting.md @@ -222,6 +222,9 @@ using (host) } ``` +> [!NOTE] +> The `UseConfiguration` extension method isn't currently capable of parsing a configuration section returned by `GetSection` (for example, `.UseConfiguration(Configuration.GetSection("section"))`. The `GetSection` method filters the configuration keys to the section requested but leaves the section name on the keys (for example, `section:urls`, `section:environment`). The `UseConfiguration` method expects the keys to match the `WebHostBuilder` keys (for example, `urls`, `environment`). The presence of the section names on the keys prevents the section's values from configuring the host. This issue will be addressed in an upcoming release. For more information and workarounds, see [Passing configuration section into WebHostBuilder.UseConfiguration uses full keys](https://github.com/aspnet/Hosting/issues/839). + ### Ordering Importance `WebHostBuilder` settings are first read from certain environment variables, if set. These environment variables must use the format `ASPNETCORE_{configurationKey}`, so for example to set the URLs the server will listen on by default, you would set `ASPNETCORE_URLS`.