ConsoleLifetime Constructors
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.
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>) |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options. |
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory) |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory. |
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)
- Source:
- ConsoleLifetime.cs
- Source:
- ConsoleLifetime.cs
- Source:
- ConsoleLifetime.cs
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options.
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))
Parameters
- options
- IOptions<ConsoleLifetimeOptions>
An object used to retrieve ConsoleLifetimeOptions instances.
- environment
- IHostEnvironment
An object that contains information about the hosting environment an application is running in.
- applicationLifetime
- IHostApplicationLifetime
An object that allows consumers to be notified of application lifetime events.
- hostOptions
- IOptions<HostOptions>
An object used to retrieve Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions instances.
Exceptions
options
or environment
or applicationLifetime
or hostOptions
is null
.
Applies to
.NET 9 (package-provided) e altre versioni
Prodotto | Versioni |
---|---|
.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) |
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)
- Source:
- ConsoleLifetime.cs
- Source:
- ConsoleLifetime.cs
- Source:
- ConsoleLifetime.cs
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory.
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)
Parameters
- options
- IOptions<ConsoleLifetimeOptions>
An object used to retrieve ConsoleLifetimeOptions instances
- environment
- IHostEnvironment
An object that contains information about the hosting environment an application is running in.
- applicationLifetime
- IHostApplicationLifetime
An object that allows consumers to be notified of application lifetime events.
- hostOptions
- IOptions<HostOptions>
An object used to retrieve Microsoft.Extensions.Hosting.Internal.ConsoleLifetime.HostOptions instances.
- loggerFactory
- ILoggerFactory
An object to configure the logging system and create instances of ILogger from the registered ILoggerProvider.
Exceptions
options
or environment
or applicationLifetime
or hostOptions
or loggerFactory
is null
.
Applies to
.NET 9 (package-provided) e altre versioni
Prodotto | Versioni |
---|---|
.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) |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: