HostApplicationBuilder Constructors
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.
Overloads
HostApplicationBuilder() |
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults. |
HostApplicationBuilder(HostApplicationBuilderSettings) |
Initializes a new instance of the HostApplicationBuilder class. |
HostApplicationBuilder(String[]) |
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults. |
HostApplicationBuilder()
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults.
public:
HostApplicationBuilder();
public HostApplicationBuilder ();
Public Sub New ()
Remarks
The following defaults are applied to the returned HostApplicationBuilder:
- Set the ContentRootPath to the result of GetCurrentDirectory().
- Load host IConfiguration from "DOTNET_" prefixed environment variables.
- Load host IConfiguration from supplied command line arguments.
- Load app IConfiguration from 'appsettings.json' and 'appsettings.[EnvironmentName].json'.
- Load app IConfiguration from User Secrets when EnvironmentName is 'Development' using the entry assembly.
- Load app IConfiguration from environment variables.
- Load app 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'.
Applies to
HostApplicationBuilder(HostApplicationBuilderSettings)
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
Initializes a new instance of the HostApplicationBuilder class.
public:
HostApplicationBuilder(Microsoft::Extensions::Hosting::HostApplicationBuilderSettings ^ settings);
public HostApplicationBuilder (Microsoft.Extensions.Hosting.HostApplicationBuilderSettings? settings);
new Microsoft.Extensions.Hosting.HostApplicationBuilder : Microsoft.Extensions.Hosting.HostApplicationBuilderSettings -> Microsoft.Extensions.Hosting.HostApplicationBuilder
Public Sub New (settings As HostApplicationBuilderSettings)
Parameters
- settings
- HostApplicationBuilderSettings
Settings that specify initial configuration and whether default settings should be used.
Applies to
HostApplicationBuilder(String[])
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
- Source:
- HostApplicationBuilder.cs
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults.
public:
HostApplicationBuilder(cli::array <System::String ^> ^ args);
public HostApplicationBuilder (string[]? args);
new Microsoft.Extensions.Hosting.HostApplicationBuilder : string[] -> Microsoft.Extensions.Hosting.HostApplicationBuilder
Public Sub New (args As String())
Parameters
- args
- String[]
The command line arguments.
Remarks
The following defaults are applied to the returned HostApplicationBuilder:
- Set the ContentRootPath to the result of GetCurrentDirectory(),
- Load host IConfiguration from "DOTNET_" prefixed environment variables,
- Load host IConfiguration from supplied command line arguments.
- Load app IConfiguration from 'appsettings.json' and 'appsettings.[EnvironmentName].json'.
- Load app IConfiguration from User Secrets when EnvironmentName is 'Development' using the entry assembly.
- Load app IConfiguration from environment variables.
- Load app IConfiguration from supplied command line arguments.
- Configure the ILoggerFactory to log to the console, debug, and event source output.
- Enable scope validation on the dependency injection container when EnvironmentName is 'Development'.