IHostEnvironment Interface
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides information about the hosting environment an application is running in.
public interface class IHostEnvironment
public interface IHostEnvironment
type IHostEnvironment = interface
Public Interface IHostEnvironment
- Derived
Application |
Gets or sets the name of the application. This property is automatically set by the host to the assembly containing the application entry point. |
Content |
Gets or sets an IFileProvider pointing at ContentRootPath. |
Content |
Gets or sets the absolute path to the directory that contains the application content files. |
Environment |
Gets or sets the name of the environment. The host automatically sets this property to the value of the "environment" key as specified in configuration. |
Is |
Checks if the current host environment name is Development. |
Is |
Compares the current host environment name against the specified value. |
Is |
Checks if the current host environment name is Production. |
Is |
Checks if the current host environment name is Staging. |
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: