Microsoft.Extensions.Hosting.WindowsServices 9.0.11

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 13 11/11/2025
10.0.0-rc.2.25502.107 19 10/15/2025
10.0.0-rc.1.25451.107 25 09/11/2025
10.0.0-preview.7.25380.108 34 08/14/2025
10.0.0-preview.6.25358.103 42 07/16/2025
10.0.0-preview.5.25277.114 35 06/06/2025
10.0.0-preview.4.25258.110 46 05/16/2025
10.0.0-preview.3.25171.5 50 04/11/2025
10.0.0-preview.2.25163.2 52 03/31/2025
10.0.0-preview.1.25080.5 55 03/31/2025
9.0.11 7 11/11/2025
9.0.10 23 10/15/2025
9.0.9 33 09/11/2025
9.0.8 29 08/05/2025
9.0.7 45 07/09/2025
9.0.6 37 06/10/2025
9.0.5 50 05/17/2025
9.0.4 55 04/10/2025
9.0.3 62 03/29/2025
9.0.2 61 03/29/2025
9.0.1 62 03/29/2025
9.0.0 66 11/14/2024
9.0.0-rc.2.24473.5 55 10/22/2024
9.0.0-rc.1.24431.7 59 09/20/2024
9.0.0-preview.7.24405.7 55 08/22/2024
9.0.0-preview.6.24327.7 83 07/23/2024
9.0.0-preview.5.24306.7 95 07/23/2024
9.0.0-preview.4.24266.19 80 07/23/2024
9.0.0-preview.3.24172.9 79 07/21/2024
9.0.0-preview.2.24128.5 77 07/23/2024
9.0.0-preview.1.24080.9 67 07/23/2024
8.0.1 67 10/22/2024
8.0.0 81 04/17/2024
8.0.0-rc.2.23479.6 75 07/23/2024
8.0.0-rc.1.23419.4 81 07/23/2024
8.0.0-preview.7.23375.6 83 07/23/2024
8.0.0-preview.6.23329.7 67 07/23/2024
8.0.0-preview.5.23280.8 88 07/20/2024
8.0.0-preview.4.23259.5 68 07/23/2024
8.0.0-preview.3.23174.8 86 07/23/2024
8.0.0-preview.2.23128.3 84 07/21/2024
8.0.0-preview.1.23110.8 85 07/23/2024
7.0.1 77 07/23/2024
7.0.0 66 07/23/2024
7.0.0-rc.2.22472.3 86 07/22/2024
7.0.0-rc.1.22426.10 82 07/23/2024
7.0.0-preview.7.22375.6 76 07/23/2024
7.0.0-preview.6.22324.4 71 07/18/2024
7.0.0-preview.5.22301.12 97 07/23/2024
7.0.0-preview.4.22229.4 87 07/22/2024
7.0.0-preview.3.22175.4 78 07/22/2024
7.0.0-preview.2.22152.2 79 07/23/2024
7.0.0-preview.1.22076.8 69 07/23/2024
6.0.3 57 11/14/2024
6.0.2 82 07/23/2024
6.0.1 86 07/23/2024
6.0.0 84 07/23/2024
6.0.0-rc.2.21480.5 84 07/23/2024
6.0.0-rc.1.21451.13 83 07/23/2024
6.0.0-preview.7.21377.19 78 07/18/2024
6.0.0-preview.6.21352.12 80 07/23/2024
6.0.0-preview.5.21301.5 74 07/23/2024
6.0.0-preview.4.21253.7 79 07/23/2024
6.0.0-preview.3.21201.4 77 07/23/2024
6.0.0-preview.2.21154.6 81 07/23/2024
5.0.1 91 07/18/2024
5.0.0 78 07/23/2024
5.0.0-rc.2.20478.4 83 07/23/2024
5.0.0-rc.1.20451.7 72 07/23/2024
5.0.0-preview.8.20407.3 84 07/23/2024
5.0.0-preview.7.20365.4 89 07/23/2024
5.0.0-preview.6.20306.1 68 07/23/2024
5.0.0-preview.5.20278.3 83 07/20/2024
5.0.0-preview.4.20251.2 84 07/23/2024
5.0.0-preview.3.20215.2 90 07/21/2024
5.0.0-preview.2.20160.3 86 07/21/2024
5.0.0-preview.1.20120.4 70 07/23/2024
3.1.32 84 07/23/2024
3.1.31 89 07/23/2024
3.1.30 89 07/18/2024
3.1.29 87 07/23/2024
3.1.28 73 07/23/2024
3.1.27 85 07/23/2024
3.1.26 99 07/23/2024
3.1.25 86 07/22/2024
3.1.24 85 07/23/2024
3.1.23 90 07/23/2024
3.1.22 94 07/23/2024
3.1.21 91 07/23/2024
3.1.20 86 07/23/2024
3.1.19 85 07/23/2024
3.1.18 91 07/23/2024
3.1.17 76 07/23/2024
3.1.16 77 07/23/2024
3.1.15 87 07/22/2024
3.1.14 76 07/23/2024
3.1.13 77 07/23/2024
3.1.12 81 07/23/2024
3.1.11 70 07/23/2024
3.1.10 76 07/23/2024
3.1.9 84 07/23/2024
3.1.8 71 07/23/2024
3.1.7 85 07/23/2024
3.1.6 91 07/23/2024
3.1.5 84 07/23/2024
3.1.4 89 07/19/2024
3.1.3 84 07/23/2024
3.1.2 85 07/23/2024
3.1.1 88 07/23/2024
3.1.0 86 07/23/2024
3.1.0-preview3.19553.2 77 07/23/2024
3.1.0-preview2.19525.4 74 07/23/2024
3.1.0-preview1.19506.1 72 07/23/2024
3.0.3 79 07/23/2024
3.0.2 85 07/23/2024
3.0.1 83 07/23/2024
3.0.0 86 07/23/2024
3.0.0-rc1.19456.10 83 07/23/2024
3.0.0-preview9.19423.4 81 07/23/2024
3.0.0-preview8.19405.4 82 07/23/2024
3.0.0-preview7.19362.4 86 07/22/2024
3.0.0-preview6.19304.6 82 07/20/2024
3.0.0-preview5.19227.9 70 07/23/2024
3.0.0-preview4.19216.2 73 07/23/2024
3.0.0-preview3.19153.1 87 07/23/2024