Udostępnij za pośrednictwem


HostApplicationBuilderSettings.DisableDefaults Property

Definition

Gets or sets a value that indicates whether the HostApplicationBuilder instance is configured with pre-configured defaults.

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 if the HostApplicationBuilder instance is configured with pre-configured defaults. This has a similar effect to calling ConfigureDefaults(IHostBuilder, String[]).

Remarks

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 args * 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'

Applies to