WindowsServiceLifetimeHostBuilderExtensions.AddWindowsService Metod

Definition

Överlagringar

Name Description
AddWindowsService(IServiceCollection)

Konfigurerar livslängden för den IHost inbyggda från services till WindowsServiceLifetime och aktiverar loggning till händelseloggen med programnamnet som standardkällnamn.

AddWindowsService(IServiceCollection, Action<WindowsServiceLifetimeOptions>)

Konfigurerar livslängden för den IHost inbyggda från services till WindowsServiceLifetime och aktiverar loggning till händelseloggen med programnamnet som standardkällnamn.

AddWindowsService(IServiceCollection)

Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs

Konfigurerar livslängden för den IHost inbyggda från services till WindowsServiceLifetime och aktiverar loggning till händelseloggen med programnamnet som standardkällnamn.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddWindowsService(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWindowsService(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddWindowsService : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddWindowsService (services As IServiceCollection) As IServiceCollection

Parametrar

services
IServiceCollection

Används IServiceCollection för att skapa IHost. Till exempel, Services eller skickas IServiceCollection till återanropet ConfigureServices(Action<HostBuilderContext,IServiceCollection>) .

Returer

Instansen services för länkning.

Kommentarer

Detta är sammanhangsberoende och aktiveras endast om det upptäcker att processen körs som en Windows-tjänst.

Gäller för

AddWindowsService(IServiceCollection, Action<WindowsServiceLifetimeOptions>)

Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs
Källa:
WindowsServiceLifetimeHostBuilderExtensions.cs

Konfigurerar livslängden för den IHost inbyggda från services till WindowsServiceLifetime och aktiverar loggning till händelseloggen med programnamnet som standardkällnamn.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddWindowsService(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Hosting::WindowsServiceLifetimeOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddWindowsService(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Hosting.WindowsServiceLifetimeOptions> configure);
static member AddWindowsService : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Hosting.WindowsServiceLifetimeOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddWindowsService (services As IServiceCollection, configure As Action(Of WindowsServiceLifetimeOptions)) As IServiceCollection

Parametrar

services
IServiceCollection

Används IServiceCollection för att skapa IHost. Till exempel, Services eller skickas IServiceCollection till återanropet ConfigureServices(Action<HostBuilderContext,IServiceCollection>) .

configure
Action<WindowsServiceLifetimeOptions>

En Action<T> för att konfigurera den angivna WindowsServiceLifetimeOptions.

Returer

Instansen services för länkning.

Kommentarer

Detta är sammanhangsberoende och aktiveras endast om det upptäcker att processen körs som en Windows-tjänst.

Gäller för