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

适用于