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

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