Microsoft.Extensions.Hosting.WindowsServices 10.0.0-preview.2.25163.2

About

Supports using Windows Services with the hosting infrastructure.

Key Features

  • Can configure a host to be a Windows Service.

How to Use

From a Worker Service app created using the Visual Studio template:

IHost host = Host.CreateDefaultBuilder(args)
    .ConfigureServices(services =>
    {
        services.AddHostedService<Worker>();
    })
    // Configure as a Windows Service
    .UseWindowsService(options =>
    {
        options.ServiceName = "My Service";
    })
    .Build();

host.Run();

Main Types

The main types provided by this library are:

  • Microsoft.Extensions.Hosting.WindowsServiceLifetimeHostBuilderExtensions
  • Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime

Additional Documentation

  • Microsoft.Extensions.Hosting
  • System.ServiceProcess.ServiceController

Feedback & Contributing

Microsoft.Extensions.Hosting.WindowsServices is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

No packages depend on Microsoft.Extensions.Hosting.WindowsServices.

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET Standard 2.1

.NET Standard 2.0

.NET 10.0

.NET 9.0

.NET 8.0

Version Downloads Last updated
10.0.0-preview.2.25163.2 3 31.03.2025
10.0.0-preview.1.25080.5 0 25.02.2025
9.0.3 0 11.03.2025
9.0.2 0 11.02.2025
9.0.1 3 23.01.2025
9.0.0 2 23.01.2025
9.0.0-rc.2.24473.5 7 15.10.2024
9.0.0-rc.1.24431.7 13 22.09.2024
9.0.0-preview.7.24405.7 11 25.09.2024
9.0.0-preview.6.24327.7 9 19.10.2024
9.0.0-preview.5.24306.7 2 23.01.2025
9.0.0-preview.4.24266.19 2 23.01.2025
9.0.0-preview.3.24172.9 11 25.09.2024
9.0.0-preview.2.24128.5 9 22.09.2024
9.0.0-preview.1.24080.9 2 23.01.2025
8.0.1 8 28.10.2024
8.0.0 18 07.02.2024
8.0.0-rc.2.23479.6 9 22.09.2024
8.0.0-rc.1.23419.4 2 23.01.2025
8.0.0-preview.7.23375.6 2 23.01.2025
8.0.0-preview.6.23329.7 8 22.09.2024
8.0.0-preview.5.23280.8 10 19.10.2024
8.0.0-preview.4.23259.5 12 22.09.2024
8.0.0-preview.3.23174.8 2 23.01.2025
8.0.0-preview.2.23128.3 2 23.01.2025
8.0.0-preview.1.23110.8 9 22.09.2024
7.0.1 14 22.09.2024
7.0.0 11 28.02.2024
7.0.0-rc.2.22472.3 11 25.09.2024
7.0.0-rc.1.22426.10 9 19.10.2024
7.0.0-preview.7.22375.6 2 23.01.2025
7.0.0-preview.6.22324.4 14 22.09.2024
7.0.0-preview.5.22301.12 13 22.09.2024
7.0.0-preview.4.22229.4 2 23.01.2025
7.0.0-preview.3.22175.4 8 22.09.2024
7.0.0-preview.2.22152.2 8 19.10.2024
7.0.0-preview.1.22076.8 10 19.10.2024
6.0.3 2 23.01.2025
6.0.2 7 19.10.2024
6.0.1 13 22.09.2024
6.0.0 15 20.10.2024
6.0.0-rc.2.21480.5 2 23.01.2025
6.0.0-rc.1.21451.13 13 22.09.2024
6.0.0-preview.7.21377.19 8 28.10.2024
6.0.0-preview.6.21352.12 9 28.10.2024
6.0.0-preview.5.21301.5 13 22.09.2024
6.0.0-preview.4.21253.7 7 19.10.2024
6.0.0-preview.3.21201.4 13 22.09.2024
6.0.0-preview.2.21154.6 14 22.09.2024
5.0.1 13 18.03.2024
5.0.0 13 28.10.2024
5.0.0-rc.2.20478.4 12 22.09.2024
5.0.0-rc.1.20451.7 15 25.09.2024
5.0.0-preview.8.20407.3 14 19.10.2024
5.0.0-preview.7.20365.4 2 23.01.2025
5.0.0-preview.6.20306.1 2 23.01.2025
5.0.0-preview.5.20278.3 2 23.01.2025
5.0.0-preview.4.20251.2 12 25.09.2024
5.0.0-preview.3.20215.2 2 23.01.2025
5.0.0-preview.2.20160.3 11 26.11.2024
5.0.0-preview.1.20120.4 15 25.09.2024
3.1.32 9 19.10.2024
3.1.31 2 23.01.2025
3.1.30 8 22.09.2024
3.1.29 7 26.11.2024
3.1.28 7 19.10.2024
3.1.27 13 22.09.2024
3.1.26 9 22.09.2024
3.1.25 16 19.10.2024
3.1.24 11 22.09.2024
3.1.23 12 22.09.2024
3.1.22 2 23.01.2025
3.1.21 9 22.09.2024
3.1.20 2 23.01.2025
3.1.19 2 23.01.2025
3.1.18 10 22.09.2024
3.1.17 11 22.09.2024
3.1.16 9 22.09.2024
3.1.15 10 22.09.2024
3.1.14 11 22.09.2024
3.1.13 2 23.01.2025
3.1.12 9 20.10.2024
3.1.11 2 23.01.2025
3.1.10 5 26.11.2024
3.1.9 11 25.09.2024
3.1.8 7 19.10.2024
3.1.7 2 23.01.2025
3.1.6 12 22.09.2024
3.1.5 14 19.10.2024
3.1.4 9 22.09.2024
3.1.3 8 22.09.2024
3.1.2 7 11.12.2024
3.1.1 15 22.09.2024
3.1.0 8 25.09.2024
3.1.0-preview3.19553.2 8 25.09.2024
3.1.0-preview2.19525.4 2 23.01.2025
3.1.0-preview1.19506.1 2 23.01.2025
3.0.3 10 22.09.2024
3.0.2 2 23.01.2025
3.0.1 10 22.09.2024
3.0.0 11 22.09.2024
3.0.0-rc1.19456.10 13 25.09.2024
3.0.0-preview9.19423.4 2 23.01.2025
3.0.0-preview8.19405.4 2 23.01.2025
3.0.0-preview7.19362.4 2 23.01.2025
3.0.0-preview6.19304.6 10 22.09.2024
3.0.0-preview5.19227.9 8 22.09.2024
3.0.0-preview4.19216.2 11 22.09.2024
3.0.0-preview3.19153.1 8 22.09.2024