IHostingEnvironment 接口

定义

注意

This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.

注意

IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.

提供有关其中正在运行应用程序的宿主环境的信息。

此类型已过时,并将从未来版本中删除。 建议的替代项为 Microsoft.Extensions.Hosting.IHostEnvironment。

public interface class IHostingEnvironment
public interface IHostingEnvironment
[System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", false)]
public interface IHostingEnvironment
[System.Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")]
public interface IHostingEnvironment
type IHostingEnvironment = interface
[<System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.", false)>]
type IHostingEnvironment = interface
[<System.Obsolete("IHostingEnvironment has been deprecated. Use Microsoft.Extensions.Hosting.IHostEnvironment instead.")>]
type IHostingEnvironment = interface
Public Interface IHostingEnvironment
派生
属性

属性

ApplicationName
已过时.
已过时.

获取或设置应用程序的名称。 主机自动将此属性设置为包含应用程序入口点的程序集。

ContentRootFileProvider
已过时.
已过时.

获取或设置指向 ContentRootPathIFileProvider

ContentRootPath
已过时.
已过时.

获取或设置包含应用程序内容文件的目录的绝对路径。

EnvironmentName
已过时.
已过时.

获取或设置环境的名称。 主机自动将此属性设置为配置中指定的“环境”键的值。

扩展方法

IsDevelopment(IHostingEnvironment)
已过时.
已过时.

检查当前主机环境名称是否为 Development。 此 API 不应在库中使用。有关详细信息,请参阅注解。

IsEnvironment(IHostingEnvironment, String)
已过时.
已过时.

将当前主机环境名称与指定的值进行比较。 库作者应避免使用此 API。有关详细信息,请参阅注解。

IsProduction(IHostingEnvironment)
已过时.
已过时.

检查当前主机环境名称是否为 Production。 此 API 不应在库中使用。有关详细信息,请参阅注解。

IsStaging(IHostingEnvironment)
已过时.
已过时.

检查当前主机环境名称是否为 Staging。 此 API 不应在库中使用。有关详细信息,请参阅注解。

适用于