Microsoft.Extensions.Hosting
10.0.0-preview.5.25277.101
Prefix Reserved
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.6.2
This package targets .NET Framework 4.6.2. The package is compatible with this framework or higher.
This is a prerelease version of Microsoft.Extensions.Hosting.
dotnet add package Microsoft.Extensions.Hosting --version 10.0.0-preview.5.25277.101
NuGet\Install-Package Microsoft.Extensions.Hosting -Version 10.0.0-preview.5.25277.101
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.5.25277.101" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0-preview.5.25277.101" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Extensions.Hosting --version 10.0.0-preview.5.25277.101
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Extensions.Hosting, 10.0.0-preview.5.25277.101"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Microsoft.Extensions.Hosting&version=10.0.0-preview.5.25277.101&prerelease
#tool nuget:?package=Microsoft.Extensions.Hosting&version=10.0.0-preview.5.25277.101&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
About
Contains the .NET Generic Host HostBuilder
which layers on the Microsoft.Extensions.Hosting.Abstractions
package.
Key Features
- Contains the .NET Generic Host
HostBuilder
.
How to Use
For a console app project:
using (IHost host = new HostBuilder().Build())
{
var lifetime = host.Services.GetRequiredService<IHostApplicationLifetime>();
lifetime.ApplicationStarted.Register(() =>
{
Console.WriteLine("Started");
});
lifetime.ApplicationStopping.Register(() =>
{
Console.WriteLine("Stopping firing");
Console.WriteLine("Stopping end");
});
lifetime.ApplicationStopped.Register(() =>
{
Console.WriteLine("Stopped firing");
Console.WriteLine("Stopped end");
});
host.Start();
// Listens for Ctrl+C.
host.WaitForShutdown();
}
Main Types
The main types provided by this library are:
Microsoft.Extensions.Host
.Microsoft.Extensions.Hosting.HostApplicationBuilder
Microsoft.Extensions.Hosting.HostBuilder
Microsoft.Extensions.Hosting.IHostedService
Microsoft.Extensions.Hosting.IHostedLifecycleService
Additional Documentation
- Generic host
- API documentation
Related Packages
Microsoft.Extensions.Configuration
Microsoft.Extensions.DependencyInjection
Microsoft.Extensions.Hosting.Abstractions
Microsoft.Extensions.Logging
Microsoft.Extensions.Options
Feedback & Contributing
Microsoft.Extensions.Hosting is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
-
net8.0
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
-
net9.0
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.CommandLine (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.FileExtensions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Configuration.UserSecrets (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Diagnostics (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.FileProviders.Physical (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Configuration (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Console (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.Debug (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventLog (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Logging.EventSource (>= 10.0.0-preview.5.25277.101)
- Microsoft.Extensions.Options (>= 10.0.0-preview.5.25277.101)
GitHub repositories (557)
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Hosting:
Repository | Stars |
---|---|
microsoft/PowerToys
Windows system utilities to maximize productivity
|
|
files-community/Files
A modern file manager that helps users organize their files and folders.
|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
icsharpcode/ILSpy
.NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more) - cross-platform!
|
|
jasontaylordev/CleanArchitecture
Clean Architecture Solution Template for ASP.NET Core
|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
microsoft/garnet
Garnet is a remote cache-store from Microsoft Research that offers strong performance (throughput and latency), scalability, storage, recovery, cluster sharding, key migration, and replication features. Garnet can work with existing Redis clients.
|
|
dotnet/orleans
Cloud Native application framework for .NET
|
|
Flow-Launcher/Flow.Launcher
:mag: Quick file search & app launcher for Windows with community-made plugins
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 10 Preview 4, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
|
|
HangfireIO/Hangfire
An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
|
|
babalae/better-genshin-impact
📦BetterGI · 更好的原神 - 自动拾取 | 自动剧情 | 全自动钓鱼(AI) | 全自动七圣召唤 | 自动伐木 | 自动刷本 | 自动采集/挖矿/锄地 | 一条龙 | 全连音游 - UI Automation Testing Tools For Genshin Impact
|
|
JeffreySu/WeiXinMPSDK
微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
|
|
lepoco/wpfui
WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
|
|
Kareadita/Kavita
Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
|
|
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
|
|
RayWangQvQ/BiliBiliToolPro
B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
|
|
quartznet/quartznet
Quartz Enterprise Scheduler .NET
|
|
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
|
Version | Downloads | Last updated |
---|---|---|
10.0.0-preview.5.25277.101 | 0 | 5/29/2025 |
10.0.0-preview.5.25266.103 | 0 | 5/20/2025 |
10.0.0-preview.4.25255.103 | 0 | 5/12/2025 |
3.0.0-preview.19074.2 | 2 | 1/28/2019 |
3.0.0-preview.18572.1 | 2 | 11/30/2018 |