Microsoft.Extensions.Hosting.WindowsServices 9.0.22

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.

Version Downloads Last updated
11.0.0-rc.3.26522.148 6 10/25/2026
11.0.0-rc.2.26504.105 11 10/14/2026
11.0.0-rc.1.26425.128 12 09/10/2026
11.0.0-preview.7.26381.103 19 08/13/2026
11.0.0-preview.6.26359.118 27 07/15/2026
11.0.0-preview.5.26302.115 26 06/11/2026
11.0.0-preview.4.26230.115 31 05/13/2026
11.0.0-preview.3.26207.106 41 04/15/2026
11.0.0-preview.2.26159.112 40 03/11/2026
11.0.0-preview.1.26104.118 37 02/14/2026
10.0.14 5 10/25/2026
10.0.13 11 10/14/2026
10.0.12 15 09/11/2026
10.0.11 22 08/13/2026
10.0.10 23 07/15/2026
10.0.9 25 06/11/2026
10.0.8 31 05/13/2026
10.0.7 50 04/23/2026
10.0.6 40 04/16/2026
10.0.5 41 03/13/2026
10.0.4 54 03/13/2026
10.0.3 37 02/14/2026
10.0.2 44 01/14/2026
10.0.1 8 09/29/2026
10.0.0 46 12/11/2025
10.0.0-rc.2.25502.107 35 12/20/2025
10.0.0-rc.1.25451.107 32 12/20/2025
10.0.0-preview.7.25380.108 44 12/21/2025
10.0.0-preview.6.25358.103 36 01/07/2026
10.0.0-preview.5.25277.114 51 12/21/2025
10.0.0-preview.4.25258.110 45 12/14/2025
10.0.0-preview.3.25171.5 49 12/15/2025
10.0.0-preview.2.25163.2 33 12/24/2025
10.0.0-preview.1.25080.5 32 12/21/2025
9.0.22 4 10/25/2026
9.0.21 10 10/14/2026
9.0.20 12 09/10/2026
9.0.19 20 08/13/2026
9.0.18 20 07/15/2026
9.0.17 20 06/11/2026
9.0.16 33 05/14/2026
9.0.15 53 04/16/2026
9.0.14 51 03/14/2026
9.0.13 48 02/14/2026
9.0.12 53 01/14/2026
9.0.11 47 12/14/2025
9.0.10 3 10/17/2026
9.0.9 39 12/14/2025
9.0.8 4 09/29/2026
9.0.7 5 10/07/2026
9.0.6 50 12/15/2025
9.0.5 44 12/20/2025
9.0.4 45 12/14/2025
9.0.3 50 12/11/2025
9.0.2 45 12/15/2025
9.0.1 45 12/11/2025
9.0.0 43 12/24/2025
9.0.0-rc.2.24473.5 48 12/14/2025
9.0.0-rc.1.24431.7 39 12/13/2025
9.0.0-preview.7.24405.7 46 12/14/2025
9.0.0-preview.6.24327.7 39 12/21/2025
9.0.0-preview.5.24306.7 38 12/14/2025
9.0.0-preview.4.24266.19 5 10/20/2026
9.0.0-preview.3.24172.9 43 12/21/2025
9.0.0-preview.2.24128.5 28 12/15/2025
9.0.0-preview.1.24080.9 44 12/21/2025
8.0.1 52 12/13/2025
8.0.0 55 12/11/2025
8.0.0-rc.2.23479.6 38 12/16/2025
8.0.0-rc.1.23419.4 42 12/15/2025
8.0.0-preview.7.23375.6 34 12/15/2025
8.0.0-preview.6.23329.7 37 12/14/2025
8.0.0-preview.5.23280.8 43 12/24/2025
8.0.0-preview.4.23259.5 46 12/21/2025
8.0.0-preview.3.23174.8 46 12/13/2025
8.0.0-preview.2.23128.3 46 12/11/2025
8.0.0-preview.1.23110.8 32 12/14/2025
7.0.1 2 09/28/2026
7.0.0 42 12/20/2025
7.0.0-rc.2.22472.3 45 12/19/2025
7.0.0-rc.1.22426.10 40 12/20/2025
7.0.0-preview.7.22375.6 44 12/15/2025
7.0.0-preview.6.22324.4 35 12/13/2025
7.0.0-preview.5.22301.12 33 12/17/2025
7.0.0-preview.4.22229.4 45 12/15/2025
7.0.0-preview.3.22175.4 5 10/20/2026
7.0.0-preview.2.22152.2 36 12/15/2025
7.0.0-preview.1.22076.8 39 12/15/2025
6.0.3 50 12/20/2025
6.0.2 40 12/15/2025
6.0.2-mauipre.1.22102.15 43 12/29/2025
6.0.2-mauipre.1.22054.8 29 12/29/2025
6.0.1 34 12/13/2025
6.0.0 53 12/14/2025
6.0.0-rc.2.21480.5 43 12/14/2025
6.0.0-rc.1.21451.13 45 12/14/2025
6.0.0-preview.7.21377.19 39 12/11/2025
6.0.0-preview.6.21352.12 37 12/21/2025
6.0.0-preview.5.21301.5 44 12/15/2025
6.0.0-preview.4.21253.7 8 09/28/2026
6.0.0-preview.3.21201.4 49 12/15/2025
6.0.0-preview.2.21154.6 38 12/21/2025
5.0.1 5 10/08/2026
5.0.0 45 12/24/2025
5.0.0-rc.2.20478.4 7 09/29/2026
5.0.0-rc.1.20451.7 42 12/15/2025
5.0.0-preview.8.20407.3 6 10/07/2026
5.0.0-preview.7.20365.4 29 12/12/2025
5.0.0-preview.6.20306.1 48 12/21/2025
5.0.0-preview.5.20278.3 39 12/14/2025
5.0.0-preview.4.20251.2 42 12/21/2025
5.0.0-preview.3.20215.2 48 12/14/2025
5.0.0-preview.2.20160.3 40 12/14/2025
5.0.0-preview.1.20120.4 42 12/14/2025
3.1.32 42 12/14/2025
3.1.31 44 12/13/2025
3.1.30 45 12/14/2025
3.1.29 43 12/20/2025
3.1.28 32 12/14/2025
3.1.27 26 12/16/2025
3.1.26 46 12/11/2025
3.1.25 43 12/14/2025
3.1.24 28 12/20/2025
3.1.23 43 12/11/2025
3.1.22 44 12/20/2025
3.1.21 40 12/15/2025
3.1.20 40 12/20/2025
3.1.19 27 12/15/2025
3.1.18 46 12/11/2025
3.1.17 31 12/11/2025
3.1.16 43 12/14/2025
3.1.15 42 12/14/2025
3.1.14 44 12/20/2025
3.1.13 43 12/20/2025
3.1.12 40 12/20/2025
3.1.11 40 12/15/2025
3.1.10 42 12/20/2025
3.1.9 49 12/20/2025
3.1.8 41 12/24/2025
3.1.7 38 12/20/2025
3.1.6 40 12/15/2025
3.1.5 50 12/14/2025
3.1.4 28 12/15/2025
3.1.3 46 12/14/2025
3.1.2 40 12/24/2025
3.1.1 33 12/15/2025
3.1.0 44 12/15/2025
3.1.0-preview3.19553.2 46 12/21/2025
3.1.0-preview2.19525.4 54 12/21/2025
3.1.0-preview1.19506.1 39 12/24/2025
3.0.3 35 12/14/2025
3.0.2 29 12/20/2025
3.0.1 40 12/24/2025
3.0.0 40 12/14/2025
3.0.0-rc1.19456.10 43 12/21/2025
3.0.0-preview9.19423.4 38 12/21/2025
3.0.0-preview8.19405.4 42 12/21/2025
3.0.0-preview7.19362.4 34 12/21/2025
3.0.0-preview6.19304.6 35 12/14/2025
3.0.0-preview5.19227.9 34 12/21/2025
3.0.0-preview4.19216.2 37 12/21/2025
3.0.0-preview3.19153.1 40 12/21/2025