Microsoft.Extensions.Hosting 8.0.0-rc.2.23479.6
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.
Showing the top 20 packages that depend on Microsoft.Extensions.Hosting.
Packages | Downloads |
---|---|
Microsoft.AspNetCore.Mvc.Testing
Support for writing functional tests for MVC applications.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3eeb12e106b9e913c3a4dec1a7d16da7b74149eb
|
617 |
Microsoft.AspNetCore.Mvc.Testing
Support for writing functional tests for MVC applications.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/3f1acb59718cadf111a0a796681e3d3509bb3381
|
284 |
Quantum.Framework.Core.StandardLib
Package Description
|
52 |
Quantum.Framework.Core.StandardLib
Package Description
|
53 |
Quantum.Framework.Core.StandardLib
Package Description
|
54 |
Quantum.Framework.Core.StandardLib
Package Description
|
55 |
Quantum.Framework.Core.StandardLib
Package Description
|
56 |
Quantum.Framework.Core.StandardLib
Package Description
|
57 |
Quantum.Framework.Core.StandardLib
Package Description
|
58 |
Quantum.Framework.Core.StandardLib
Package Description
|
62 |
Quantum.Framework.Core.StandardLib
Package Description
|
65 |
Quantum.Framework.Core.StandardLib
Package Description
|
74 |
Quantum.Framework.Core.StandardLib
Package Description
|
77 |
Quantum.Framework.Core.StandardLib
Package Description
|
114 |
Quantum.Framework.Core.StandardLib
Package Description
|
153 |
Quantum.Framework.Core.StandardLib
Package Description
|
160 |
Quantum.Framework.Core.StandardLib
Package Description
|
167 |
Xunit.DependencyInjection
Use Microsoft.Extensions.DependencyInjection to inject xunit testclass. If you want write Microsoft.Extensions.Logging to ITestOutputHelper, please install Xunit.DependencyInjection.Logging
Release notes:
7.0: Add fixture injection and refactor DependencyInjectionTestFramework, you don't have to declare the [assembly: TestFrameworkAttribute] on normal case.
|
210 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0-rc.2.23479.6)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
.NET Standard 2.0
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
.NET 8.0
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
.NET Standard 2.1
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
.NET 7.0
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
.NET 6.0
- Microsoft.Extensions.Configuration.UserSecrets (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.FileExtensions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.CommandLine (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Diagnostics (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.FileProviders.Physical (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Console (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Debug (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.Configuration (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventSource (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Options (>= 8.0.0-rc.2.23479.6)
- Microsoft.Extensions.Logging.EventLog (>= 8.0.0-rc.2.23479.6)