Host.CreateApplicationBuilder Method
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.
CreateApplicationBuilder() |
Initializes a new instance of the HostApplicationBuilder class with pre-configured defaults. |
CreateApplicationBuilder(HostApplicationBuilderSettings) |
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults. |
CreateApplicationBuilder(String[]) |
Initializes a new instance of the HostApplicationBuilder class with pre-configured defaults. |
- Source:
- Host.cs
- Source:
- Host.cs
- Source:
- Host.cs
Initializes a new instance of the HostApplicationBuilder class with pre-configured defaults.
public:
static Microsoft::Extensions::Hosting::HostApplicationBuilder ^ CreateApplicationBuilder();
public static Microsoft.Extensions.Hosting.HostApplicationBuilder CreateApplicationBuilder ();
static member CreateApplicationBuilder : unit -> Microsoft.Extensions.Hosting.HostApplicationBuilder
Public Shared Function CreateApplicationBuilder () As HostApplicationBuilder
Returns
The initialized HostApplicationBuilder.
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 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
- 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
.NET 9 (package-provided) e outras versões
Produto | Versões |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
- Source:
- Host.cs
- Source:
- Host.cs
- Source:
- Host.cs
Initializes a new instance of the HostApplicationBuilder class with preconfigured defaults.
public:
static Microsoft::Extensions::Hosting::HostApplicationBuilder ^ CreateApplicationBuilder(Microsoft::Extensions::Hosting::HostApplicationBuilderSettings ^ settings);
public static Microsoft.Extensions.Hosting.HostApplicationBuilder CreateApplicationBuilder (Microsoft.Extensions.Hosting.HostApplicationBuilderSettings? settings);
static member CreateApplicationBuilder : Microsoft.Extensions.Hosting.HostApplicationBuilderSettings -> Microsoft.Extensions.Hosting.HostApplicationBuilder
Public Shared Function CreateApplicationBuilder (settings As HostApplicationBuilderSettings) As HostApplicationBuilder
Parameters
- settings
- HostApplicationBuilderSettings
Controls the initial configuration and other settings for constructing the HostApplicationBuilder.
Returns
A new HostApplicationBuilder instance.
Applies to
.NET 9 (package-provided) e outras versões
Produto | Versões |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
- Source:
- Host.cs
- Source:
- Host.cs
- Source:
- Host.cs
Initializes a new instance of the HostApplicationBuilder class with pre-configured defaults.
public:
static Microsoft::Extensions::Hosting::HostApplicationBuilder ^ CreateApplicationBuilder(cli::array <System::String ^> ^ args);
public static Microsoft.Extensions.Hosting.HostApplicationBuilder CreateApplicationBuilder (string[]? args);
static member CreateApplicationBuilder : string[] -> Microsoft.Extensions.Hosting.HostApplicationBuilder
Public Shared Function CreateApplicationBuilder (args As String()) As HostApplicationBuilder
Parameters
- args
- String[]
The command line args.
Returns
The initialized HostApplicationBuilder.
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 args
- 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 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
.NET 9 (package-provided) e outras versões
Produto | Versões |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: