共用方式為


HostingEnvironmentExtensions.IsProduction(IHostingEnvironment) 方法

定義

檢查目前的主控環境名稱是否為 Production

public:
[System::Runtime::CompilerServices::Extension]
 static bool IsProduction(Microsoft::AspNetCore::Hosting::IHostingEnvironment ^ hostingEnvironment);
public static bool IsProduction (this Microsoft.AspNetCore.Hosting.IHostingEnvironment hostingEnvironment);
static member IsProduction : Microsoft.AspNetCore.Hosting.IHostingEnvironment -> bool
<Extension()>
Public Function IsProduction (hostingEnvironment As IHostingEnvironment) As Boolean

參數

hostingEnvironment
IHostingEnvironment

IHostingEnvironment 的執行個體。

傳回

如果環境名稱為 ,則為 True,否則為 Production false。

適用於