HostEnvironmentEnvExtensions.IsProduction(IHostEnvironment) 方法

定義

檢查目前主機環境名稱是否為 Production。 此 API 不應用於程式庫中,如需詳細資料,請參閱備註。

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

參數

hostEnvironment
IHostEnvironment

IHostEnvironment 的執行個體。

傳回

若環境名稱是 Production,則為 true;否則為 false

備註

環境名稱 「開發」、「生產」和「預備」會作為應用程式開發人員的公用程式提供。 連結庫作者應該避免將這些環境名稱的特定行為結合在一起。

適用於