共用方式為


HostingHostBuilderExtensions.UseEnvironment(IHostBuilder, String) 方法

定義

指定要由主機使用的環境。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseEnvironment(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, System::String ^ environment);
public static Microsoft.Extensions.Hosting.IHostBuilder UseEnvironment (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, string environment);
static member UseEnvironment : Microsoft.Extensions.Hosting.IHostBuilder * string -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseEnvironment (hostBuilder As IHostBuilder, environment As String) As IHostBuilder

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilder

environment
String

要在其中裝載應用程式的環境。

傳回

IHostBuilder

適用於