HostApplicationBuilderSettings.DisableDefaults Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that specifies whether preconfigured default settings should be used to configure the HostApplicationBuilder instance.
public:
property bool DisableDefaults { bool get(); void set(bool value); };
public bool DisableDefaults { get; set; }
member this.DisableDefaults : bool with get, set
Public Property DisableDefaults As Boolean
Property Value
false
to configure the HostApplicationBuilder instance with preconfigured default settings; true
to disable the use of default settings.
Remarks
Setting this property to false
has a similar effect to calling ConfigureDefaults(IHostBuilder, String[]).
The following defaults are applied to the IHostBuilder:
- Set the ContentRootPath to the result of GetCurrentDirectory().
- Load IConfiguration from "DOTNET_" prefixed environment variables.
- Load IConfiguration from 'appsettings.json' and 'appsettings.[EnvironmentName].json'.
- Load IConfiguration from User Secrets when EnvironmentName is 'Development' using the entry assembly.
- Load IConfiguration from environment variables.
- Load IConfiguration from supplied command line arguments.
- Configure the ILoggerFactory to log to the console, debug, and event source output.
- Enables scope validation on the dependency injection container when EnvironmentName is 'Development'.