Microsoft.Extensions.Hosting.WindowsServices
v11.0.0-rc.2.26504.105Latest Pre-release
net10.0net11.0.NETFramework4.6.2.NETStandard2.0.NETStandard2.1
.NET hosting infrastructure for Windows Services.
Published
Oct 13, 2026
7d ago
Total Downloads
110.5M
110,466,871
Install
dotnet add package Microsoft.Extensions.Hosting.WindowsServices --version 11.0.0-rc.2.26504.105
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard | |
| Other |
README
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.
Changes from Previous Version
No structural changes between v11.0.0-rc.1.26425.128 and v11.0.0-rc.2.26504.105.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.The published metadata declares 14 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.