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