IHostingEnvironment IHostingEnvironment Interface

Provides information about the web hosting environment an application is running in.

Syntax

Declaration

public interface IHostingEnvironmentPublic Interface IHostingEnvironment

Properties summary

Gets or sets the name of the application. This property is automatically set by the host to the assembly containing the application entry point.
Gets or sets an IFileProvider pointing at ContentRootPath.
Gets or sets the absolute path to the directory that contains the application content files.
Gets or sets the name of the environment. This property is automatically set by the host to the value of the "ASPNETCORE_ENVIRONMENT" environment variable.
Gets or sets an IFileProvider pointing at WebRootPath.
Gets or sets the absolute path to the directory that contains the web-servable application content files.

Properties

  • ApplicationName
    ApplicationName
    Gets or sets the name of the application. This property is automatically set by the host to the assembly containing the application entry point.
    string ApplicationName { get; set; }Property ApplicationName As String

    Property Value

    • System.String
      System.String
  • ContentRootFileProvider
    ContentRootFileProvider
    Gets or sets an IFileProvider pointing at ContentRootPath.
    IFileProvider ContentRootFileProvider { get; set; }Property ContentRootFileProvider As IFileProvider

    Property Value

  • ContentRootPath
    ContentRootPath
    Gets or sets the absolute path to the directory that contains the application content files.
    string ContentRootPath { get; set; }Property ContentRootPath As String

    Property Value

    • System.String
      System.String
  • EnvironmentName
    EnvironmentName
    Gets or sets the name of the environment. This property is automatically set by the host to the value of the "ASPNETCORE_ENVIRONMENT" environment variable.
    string EnvironmentName { get; set; }Property EnvironmentName As String

    Property Value

    • System.String
      System.String
  • WebRootFileProvider
    WebRootFileProvider
    Gets or sets an IFileProvider pointing at WebRootPath.
    IFileProvider WebRootFileProvider { get; set; }Property WebRootFileProvider As IFileProvider

    Property Value

  • WebRootPath
    WebRootPath
    Gets or sets the absolute path to the directory that contains the web-servable application content files.
    string WebRootPath { get; set; }Property WebRootPath As String

    Property Value

    • System.String
      System.String

Details

Assembly

Microsoft.AspNetCore.Hosting.Abstractions.dll