Microsoft.Extensions.Hosting.WindowsServices 11.0.0

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