AddDefaults Method
AddDefaults(IConfigurationBuilder, String[], String)
Adds the default IConfigurationProvider instances.
Declaration
public static IConfigurationBuilder AddDefaults(this IConfigurationBuilder configurationBuilder, string[] args, string environmentName = null)
Parameters
IConfigurationBuilder | configurationBuilder | The IConfigurationBuilder to add to. |
String[] | args | The command line args. |
String | environmentName | An optional environment name. |
Returns
IConfigurationBuilder |
Remarks
Adds support for appsettings.json, environment variables and command line arguments. This is only useful in non-hosted environments where a configuration builder is created from scratch.
If environmentName
is missing, the environment name is determined using
the DOTNET_ENVIRONMENT
and ASPNETCORE_ENVIRONMENT
environment variables. If not
specified, the environment name is Production
.