diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs b/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs
index cba94f40fe..f4613dd7d9 100644
--- a/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs
+++ b/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs
@@ -8,7 +8,30 @@ namespace Microsoft.AspNetCore.Hosting
///
/// Allows consumers to perform cleanup during a graceful shutdown.
///
- public interface IApplicationLifetime : Extensions.Hosting.IApplicationLifetime
+ public interface IApplicationLifetime
{
+ ///
+ /// Triggered when the application host has fully started and is about to wait
+ /// for a graceful shutdown.
+ ///
+ CancellationToken ApplicationStarted { get; }
+
+ ///
+ /// Triggered when the application host is performing a graceful shutdown.
+ /// Requests may still be in flight. Shutdown will block until this event completes.
+ ///
+ CancellationToken ApplicationStopping { get; }
+
+ ///
+ /// Triggered when the application host is performing a graceful shutdown.
+ /// All requests should be complete at this point. Shutdown will block
+ /// until this event completes.
+ ///
+ CancellationToken ApplicationStopped { get; }
+
+ ///
+ /// Requests termination of the current application.
+ ///
+ void StopApplication();
}
}
diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs b/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs
index 8278ba9f85..5feeb38eb7 100644
--- a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs
+++ b/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs
@@ -8,8 +8,20 @@ namespace Microsoft.AspNetCore.Hosting
///
/// Provides information about the web hosting environment an application is running in.
///
- public interface IHostingEnvironment : Extensions.Hosting.IHostingEnvironment
+ public interface IHostingEnvironment
{
+ ///
+ /// Gets or sets the name of the environment. The host automatically sets this property to the value
+ /// of the "ASPNETCORE_ENVIRONMENT" environment variable, or "environment" as specified in any other configuration source.
+ ///
+ string EnvironmentName { get; set; }
+
+ ///
+ /// 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; }
+
///
/// Gets or sets the absolute path to the directory that contains the web-servable application content files.
///
@@ -19,5 +31,15 @@ namespace Microsoft.AspNetCore.Hosting
/// Gets or sets an pointing at .
///
IFileProvider WebRootFileProvider { get; set; }
+
+ ///
+ /// Gets or sets the absolute path to the directory that contains the application content files.
+ ///
+ string ContentRootPath { get; set; }
+
+ ///
+ /// Gets or sets an pointing at .
+ ///
+ IFileProvider ContentRootFileProvider { get; set; }
}
}
diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs b/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs
index 47d16e9654..958f8b5dcc 100644
--- a/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs
+++ b/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
///
/// Allows consumers to perform cleanup during a graceful shutdown.
///
- public class ApplicationLifetime : IApplicationLifetime
+ public class ApplicationLifetime : IApplicationLifetime, Extensions.Hosting.IApplicationLifetime
{
private readonly CancellationTokenSource _startedSource = new CancellationTokenSource();
private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource();
diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs b/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs
index 34924ab365..1f8d1887d7 100644
--- a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs
+++ b/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs
@@ -5,7 +5,7 @@ using Microsoft.Extensions.FileProviders;
namespace Microsoft.AspNetCore.Hosting.Internal
{
- public class HostingEnvironment : IHostingEnvironment
+ public class HostingEnvironment : IHostingEnvironment, Extensions.Hosting.IHostingEnvironment
{
public string EnvironmentName { get; set; } = Hosting.EnvironmentName.Production;