HostingEnvironment 類別

定義

此 API 支援基礎結構,且不適合直接從程式碼使用。 此 API 可能會在未來的版本中變更或移除。

public ref class HostingEnvironment : Microsoft::Extensions::Hosting::IHostingEnvironment
public ref class HostingEnvironment : Microsoft::Extensions::Hosting::IHostEnvironment, Microsoft::Extensions::Hosting::IHostingEnvironment
public class HostingEnvironment : Microsoft.Extensions.Hosting.IHostingEnvironment
public class HostingEnvironment : Microsoft.Extensions.Hosting.IHostEnvironment, Microsoft.Extensions.Hosting.IHostingEnvironment
type HostingEnvironment = class
    interface IHostingEnvironment
type HostingEnvironment = class
    interface IHostingEnvironment
    interface IHostEnvironment
type HostingEnvironment = class
    interface IHostEnvironment
    interface IHostingEnvironment
Public Class HostingEnvironment
Implements IHostingEnvironment
Public Class HostingEnvironment
Implements IHostEnvironment, IHostingEnvironment
繼承
HostingEnvironment
實作

建構函式

HostingEnvironment()

此 API 支援基礎結構,且不適合直接從程式碼使用。 此 API 可能會在未來的版本中變更或移除。

屬性

ApplicationName

取得或設定應用程式的名稱。 主機會自動將此屬性設定為包含應用程式進入點的組件。

ContentRootFileProvider

取得或設定指向 ContentRootPathIFileProvider

ContentRootPath

取得或設定包含應用程式內容檔案的目錄絕對路徑。

EnvironmentName

取得或設定環境的名稱。 主機會自動將此屬性設定為組態中指定的 "environment" 索引鍵值。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

擴充方法

IsDevelopment(IHostEnvironment)

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

IsEnvironment(IHostEnvironment, String)

比較目前主機環境名稱與指定的值。 程式庫作者應避免使用此 API,如需詳細資料,請參閱備註。

IsProduction(IHostEnvironment)

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

IsStaging(IHostEnvironment)

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

IsDevelopment(IHostingEnvironment)

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

IsEnvironment(IHostingEnvironment, String)

比較目前主控環境名稱與指定的值。 程式庫作者應避免使用此 API,如需詳細資料,請參閱備註。

IsProduction(IHostingEnvironment)

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

IsStaging(IHostingEnvironment)

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

適用於