Číst v angličtině

Sdílet prostřednictvím


HostingHostBuilderExtensions.UseEnvironment(IHostBuilder, String) Method

Definition

Specifies the environment to be used by the host. To avoid the environment being overwritten by a default value, ensure this is called after defaults are configured.

C#
public static Microsoft.Extensions.Hosting.IHostBuilder UseEnvironment(this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, string environment);

Parameters

hostBuilder
IHostBuilder

The IHostBuilder to configure.

environment
String

The environment to host the application in.

Returns

The IHostBuilder.

Applies to

Produkt Verze
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)