Microsoft.Extensions.Hosting.WindowsServices 10.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.

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

Version Downloads Last updated
10.0.0 6 11/16/2025
10.0.0-rc.2.25502.107 8 10/16/2025
10.0.0-rc.1.25451.107 9 09/12/2025
10.0.0-preview.7.25380.108 9 08/18/2025
10.0.0-preview.6.25358.103 15 07/16/2025
10.0.0-preview.5.25277.114 17 06/10/2025
10.0.0-preview.4.25258.110 17 05/13/2025
10.0.0-preview.3.25171.5 24 04/12/2025
10.0.0-preview.2.25163.2 29 03/23/2025
10.0.0-preview.1.25080.5 27 02/26/2025
9.0.11 2 11/17/2025
9.0.10 8 10/16/2025
9.0.9 7 09/12/2025
9.0.8 8 08/07/2025
9.0.7 13 07/13/2025
9.0.6 12 06/14/2025
9.0.5 19 05/15/2025
9.0.4 22 04/12/2025
9.0.3 25 03/25/2025
9.0.2 24 02/14/2025
9.0.1 33 01/19/2025
9.0.0 35 11/13/2024
9.0.0-rc.2.24473.5 36 10/18/2024
9.0.0-rc.1.24431.7 27 09/20/2024
9.0.0-preview.7.24405.7 42 08/14/2024
9.0.0-preview.6.24327.7 47 07/10/2024
9.0.0-preview.5.24306.7 44 06/21/2024
9.0.0-preview.4.24266.19 34 06/21/2024
9.0.0-preview.3.24172.9 44 04/11/2024
9.0.0-preview.2.24128.5 42 03/25/2024
9.0.0-preview.1.24080.9 38 02/18/2024
8.0.1 35 10/11/2024
8.0.0 57 11/16/2023
8.0.0-rc.2.23479.6 46 10/16/2023
8.0.0-rc.1.23419.4 47 09/14/2023
8.0.0-preview.7.23375.6 53 08/20/2023
8.0.0-preview.6.23329.7 53 07/20/2023
8.0.0-preview.5.23280.8 60 06/27/2023
8.0.0-preview.4.23259.5 48 06/06/2023
8.0.0-preview.3.23174.8 47 04/27/2023
8.0.0-preview.2.23128.3 46 04/06/2023
8.0.0-preview.1.23110.8 48 04/06/2023
7.0.1 47 07/23/2023
7.0.0 60 12/18/2022
7.0.0-rc.2.22472.3 50 07/07/2023
7.0.0-rc.1.22426.10 44 07/14/2023
7.0.0-preview.7.22375.6 46 07/09/2023
7.0.0-preview.6.22324.4 60 09/30/2022
7.0.0-preview.5.22301.12 42 04/06/2023
7.0.0-preview.4.22229.4 47 04/06/2023
7.0.0-preview.3.22175.4 48 07/18/2023
7.0.0-preview.2.22152.2 41 07/07/2023
7.0.0-preview.1.22076.8 43 07/07/2023
6.0.3 34 11/13/2024
6.0.2 54 07/25/2023
6.0.2-mauipre.1.22102.15 57 09/24/2022
6.0.2-mauipre.1.22054.8 49 04/02/2023
6.0.1 54 01/25/2023
6.0.0 60 06/03/2022
6.0.0-rc.2.21480.5 50 10/31/2022
6.0.0-rc.1.21451.13 55 07/07/2023
6.0.0-preview.7.21377.19 53 07/07/2023
6.0.0-preview.6.21352.12 46 12/05/2022
6.0.0-preview.5.21301.5 50 04/06/2023
6.0.0-preview.4.21253.7 50 05/25/2023
6.0.0-preview.3.21201.4 47 05/28/2023
6.0.0-preview.2.21154.6 43 07/12/2023
5.0.1 60 06/29/2022
5.0.0 53 04/13/2023
5.0.0-rc.2.20478.4 54 07/13/2023
5.0.0-rc.1.20451.7 44 03/18/2023
5.0.0-preview.8.20407.3 50 04/06/2023
5.0.0-preview.7.20365.4 44 07/13/2023
5.0.0-preview.6.20306.1 48 04/06/2023
5.0.0-preview.5.20278.3 53 04/06/2023
5.0.0-preview.4.20251.2 45 11/16/2022
5.0.0-preview.3.20215.2 47 07/09/2023
5.0.0-preview.2.20160.3 46 07/10/2023
5.0.0-preview.1.20120.4 46 04/06/2023
3.1.32 55 04/02/2023
3.1.31 54 05/16/2023
3.1.30 53 07/11/2023
3.1.29 58 01/20/2023
3.1.28 51 04/12/2023
3.1.27 50 03/17/2023
3.1.26 52 04/06/2023
3.1.25 56 03/18/2023
3.1.24 61 09/07/2022
3.1.23 54 03/29/2023
3.1.22 52 04/23/2023
3.1.21 53 10/29/2022
3.1.20 53 05/24/2023
3.1.19 54 09/18/2022
3.1.18 52 10/04/2022
3.1.17 53 04/06/2023
3.1.16 61 10/15/2022
3.1.15 51 03/27/2023
3.1.14 56 03/30/2023
3.1.13 49 03/25/2023
3.1.12 48 04/18/2023
3.1.11 51 06/11/2022
3.1.10 54 03/07/2023
3.1.9 52 03/22/2023
3.1.8 58 04/06/2023
3.1.7 58 04/06/2023
3.1.6 59 10/07/2022
3.1.5 53 03/27/2023
3.1.4 51 04/06/2023
3.1.3 49 04/01/2023
3.1.2 60 03/27/2023
3.1.1 56 02/26/2023
3.1.0 59 04/06/2023
3.1.0-preview3.19553.2 44 02/17/2023
3.1.0-preview2.19525.4 46 07/08/2023
3.1.0-preview1.19506.1 48 07/10/2023
3.0.3 53 03/01/2023
3.0.2 59 05/02/2023
3.0.1 66 01/17/2023
3.0.0 56 11/06/2022
3.0.0-rc1.19456.10 47 04/06/2023
3.0.0-preview9.19423.4 41 07/17/2023
3.0.0-preview8.19405.4 51 09/10/2022
3.0.0-preview7.19362.4 48 04/06/2023
3.0.0-preview6.19304.6 44 07/10/2023
3.0.0-preview5.19227.9 44 07/11/2023
3.0.0-preview4.19216.2 47 07/11/2023
3.0.0-preview3.19153.1 48 07/11/2023