You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs
+130Lines changed: 130 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,13 @@
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
usingSystem;
5
+
usingSystem.IO;
5
6
usingSystem.Runtime.Versioning;
7
+
usingSystem.Security;
6
8
usingSystem.Threading;
7
9
usingSystem.Threading.Tasks;
10
+
usingMicrosoft.Extensions.Configuration;
11
+
usingMicrosoft.Extensions.FileProviders;
8
12
usingMicrosoft.Extensions.Logging;
9
13
usingMicrosoft.Extensions.Logging.Abstractions;
10
14
usingMicrosoft.Extensions.Options;
@@ -44,6 +48,19 @@ public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironmen
44
48
/// <param name="loggerFactory">An object to configure the logging system and create instances of <see cref="ILogger"/> from the registered <see cref="ILoggerProvider"/>.</param>
45
49
/// <exception cref="ArgumentNullException"><paramref name="options"/> or <paramref name="environment"/> or <paramref name="applicationLifetime"/> or <paramref name="hostOptions"/> or <paramref name="loggerFactory"/> is <see langword="null"/>.</exception>
/// Initializes a <see cref="ConsoleLifetime"/> instance using the specified console lifetime options, host environment, host options, logger factory, and application configuration.
55
+
/// </summary>
56
+
/// <param name="options">An object used to retrieve <see cref="ConsoleLifetimeOptions"/> instances.</param>
57
+
/// <param name="environment">Information about the hosting environment an application is running in.</param>
58
+
/// <param name="applicationLifetime">An object that allows consumers to be notified of application lifetime events.</param>
59
+
/// <param name="hostOptions">An object used to retrieve <see cref="HostOptions"/> instances.</param>
60
+
/// <param name="loggerFactory">An object to configure the logging system and create instances of <see cref="ILogger"/> from the registered <see cref="ILoggerProvider"/>.</param>
61
+
/// <param name="configuration">The application's <see cref="IConfiguration"/>, used to inspect file-based configuration sources for diagnostic logging. May be <see langword="null"/>.</param>
62
+
/// <exception cref="ArgumentNullException"><paramref name="options"/> or <paramref name="environment"/> or <paramref name="applicationLifetime"/> or <paramref name="hostOptions"/> or <paramref name="loggerFactory"/> is <see langword="null"/>.</exception>
Logger.LogInformation("Content root path is the current working directory ({ContentRoot}). To override, set the content root explicitly.",Environment.ContentRootPath);
0 commit comments