Microsoft.Extensions.Hosting.WindowsServices 9.0.2
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.WindowsServiceLifetimeHostBuilderExtensionsMicrosoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime
Additional Documentation
- WindowsServiceLifetime
- WindowsServiceLifetimeHostBuilderExtensions
- Create Windows Service using BackgroundService
- Host ASP.NET Core in a Windows Service
Related Packages
Microsoft.Extensions.HostingSystem.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
- Microsoft.Extensions.Hosting (>= 9.0.2)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.2)
.NET Standard 2.1
- System.ServiceProcess.ServiceController (>= 9.0.2)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.2)
- Microsoft.Extensions.Hosting (>= 9.0.2)
.NET Standard 2.0
- System.ServiceProcess.ServiceController (>= 9.0.2)
- Microsoft.Extensions.Hosting (>= 9.0.2)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.2)
.NET 9.0
- System.ServiceProcess.ServiceController (>= 9.0.2)
- Microsoft.Extensions.Hosting (>= 9.0.2)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.2)
.NET 8.0
- System.ServiceProcess.ServiceController (>= 9.0.2)
- Microsoft.Extensions.Logging.EventLog (>= 9.0.2)
- Microsoft.Extensions.Hosting (>= 9.0.2)
| Version | Downloads | Last updated |
|---|---|---|
| 9.0.2 | 14 | 02/18/2025 |
| 9.0.1 | 12 | 02/18/2025 |
| 9.0.0 | 12 | 02/18/2025 |
| 9.0.0-preview.2.24128.5 | 13 | 02/18/2025 |
| 8.0.1 | 12 | 02/18/2025 |
| 8.0.0 | 12 | 02/18/2025 |
| 7.0.1 | 12 | 02/18/2025 |
| 7.0.0 | 13 | 10/07/2023 |
| 6.0.3 | 12 | 02/18/2025 |
| 6.0.2 | 12 | 02/18/2025 |
| 6.0.1 | 12 | 02/18/2025 |
| 6.0.0 | 12 | 02/18/2025 |
| 5.0.1 | 12 | 02/18/2025 |
| 5.0.0 | 12 | 02/18/2025 |
| 3.1.32 | 12 | 02/18/2025 |
| 3.1.31 | 12 | 02/18/2025 |
| 3.1.30 | 12 | 02/18/2025 |
| 3.1.29 | 12 | 02/18/2025 |
| 3.1.28 | 12 | 02/18/2025 |
| 3.1.27 | 12 | 02/18/2025 |
| 3.1.26 | 12 | 02/18/2025 |
| 3.1.25 | 12 | 02/18/2025 |
| 3.1.24 | 12 | 02/18/2025 |
| 3.1.23 | 12 | 02/18/2025 |
| 3.1.22 | 12 | 02/18/2025 |
| 3.1.21 | 12 | 02/18/2025 |
| 3.1.20 | 12 | 02/18/2025 |
| 3.1.19 | 12 | 02/18/2025 |
| 3.1.18 | 13 | 02/18/2025 |
| 3.1.17 | 12 | 02/18/2025 |
| 3.1.16 | 12 | 02/18/2025 |
| 3.1.15 | 12 | 02/18/2025 |
| 3.1.14 | 12 | 02/18/2025 |
| 3.1.13 | 13 | 02/18/2025 |
| 3.1.12 | 12 | 02/18/2025 |
| 3.1.11 | 12 | 02/18/2025 |
| 3.1.10 | 11 | 02/18/2025 |
| 3.1.9 | 12 | 02/18/2025 |
| 3.1.8 | 13 | 02/18/2025 |
| 3.1.7 | 13 | 02/18/2025 |
| 3.1.6 | 12 | 02/18/2025 |
| 3.1.5 | 12 | 02/18/2025 |
| 3.1.4 | 13 | 02/18/2025 |
| 3.1.3 | 12 | 02/18/2025 |
| 3.1.2 | 12 | 02/18/2025 |
| 3.1.1 | 12 | 02/18/2025 |
| 3.1.0 | 12 | 02/18/2025 |
| 3.0.3 | 13 | 02/18/2025 |
| 3.0.2 | 12 | 02/18/2025 |
| 3.0.1 | 12 | 02/18/2025 |
| 3.0.0 | 12 | 02/18/2025 |