共用方式為


HostingAbstractionsWebHostBuilderExtensions.UseEnvironment 方法

定義

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

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

參數

hostBuilder
IWebHostBuilder

要設定的 IWebHostBuilder

environment
String

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

傳回

IWebHostBuilder

適用於