共用方式為


ConsoleLifetime 建構函式

定義

多載

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

此 API 支援基礎結構,並不適合直接從您的程式代碼使用。 此 API 可能會在未來版本中變更或移除。

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

此 API 支援基礎結構,並不適合直接從您的程式代碼使用。 此 API 可能會在未來版本中變更或移除。

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs

此 API 支援基礎結構,並不適合直接從您的程式代碼使用。 此 API 可能會在未來版本中變更或移除。

public:
 ConsoleLifetime(Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ options, Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ hostOptions);
public ConsoleLifetime (Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions);
new Microsoft.Extensions.Hosting.Internal.ConsoleLifetime : Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> -> Microsoft.Extensions.Hosting.Internal.ConsoleLifetime
Public Sub New (options As IOptions(Of ConsoleLifetimeOptions), environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, hostOptions As IOptions(Of HostOptions))

參數

options
IOptions<ConsoleLifetimeOptions>

用來擷取 ConsoleLifetimeOptions 實例的物件。

environment
IHostEnvironment

物件,其中包含應用程式正在執行之主控環境的相關信息。

applicationLifetime
IHostApplicationLifetime

物件,可讓取用者收到應用程式存留期事件的通知。

hostOptions
IOptions<HostOptions>

用來擷取 Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions 實例的物件。

例外狀況

optionsenvironmentapplicationLifetimehostOptionsnull

適用於

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs
來源:
ConsoleLifetime.cs

此 API 支援基礎結構,並不適合直接從您的程式代碼使用。 此 API 可能會在未來版本中變更或移除。

public:
 ConsoleLifetime(Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ options, Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ hostOptions, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public ConsoleLifetime (Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> options, Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> hostOptions, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.Extensions.Hosting.Internal.ConsoleLifetime : Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Extensions.Hosting.Internal.ConsoleLifetime
Public Sub New (options As IOptions(Of ConsoleLifetimeOptions), environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, hostOptions As IOptions(Of HostOptions), loggerFactory As ILoggerFactory)

參數

options
IOptions<ConsoleLifetimeOptions>

用來擷取 ConsoleLifetimeOptions 實例的物件

environment
IHostEnvironment

物件,其中包含應用程式正在執行之主控環境的相關信息。

applicationLifetime
IHostApplicationLifetime

物件,可讓取用者收到應用程式存留期事件的通知。

hostOptions
IOptions<HostOptions>

用來擷取 Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions 實例的物件。

loggerFactory
ILoggerFactory

對象,用來設定記錄系統,並從已註冊的 ILoggerProvider建立 ILogger 實例。

例外狀況

optionsenvironmentapplicationLifetimehostOptionsloggerFactorynull

適用於