Microsoft.Extensions.Hosting 10.0.15

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

  • 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
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
60
Aspire.Hosting.AppHost
Core library and MSBuild logic for Aspire AppHost projects.
58
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
58
Aspire.Hosting
Core abstractions for the Aspire application model.
57
Aspire.Hosting
Core API and abstractions for the .NET Aspire application model.
56
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
56
Aspire.Hosting.AppHost
Core library and MSBuild logic for .NET Aspire AppHost projects.
55
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
55
Microsoft.Extensions.Options.ValidateOnStart
Support for extended option validation.
54
Aspire.Hosting
Core abstractions for the Aspire application model.
54
Aspire.Hosting.AppHost
Core library and MSBuild logic for .NET Aspire AppHost projects.
53
Aspire.Hosting.AppHost
Core library and MSBuild logic for Aspire AppHost projects.
53
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
52
Aspire.Hosting
Core abstractions for the .NET Aspire application model.
51
Aspire.Hosting
Core abstractions for the Aspire application model.
51
Aspire.Hosting.AppHost
Core library and MSBuild logic for .NET Aspire AppHost projects.
51

.NET Framework 4.6.2

.NET 8.0

.NET 9.0

.NET 10.0

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
11.0.0 3 11/11/2026
11.0.0-rc.3.26522.148 15 10/28/2026
11.0.0-rc.2.26504.105 18 10/14/2026
11.0.0-rc.1.26425.128 24 9/9/2026
11.0.0-preview.7.26381.103 30 8/13/2026
11.0.0-preview.6.26359.118 37 7/17/2026
11.0.0-preview.5.26302.115 37 6/10/2026
11.0.0-preview.4.26230.115 33 5/13/2026
11.0.0-preview.3.26207.106 42 5/4/2026
11.0.0-preview.2.26159.112 50 3/12/2026
11.0.0-preview.1.26104.118 52 2/12/2026
10.0.15 3 11/11/2026
10.0.14 16 10/28/2026
10.0.13 21 10/14/2026
10.0.12 28 9/9/2026
10.0.11 27 8/13/2026
10.0.10 39 7/18/2026
10.0.9 30 6/10/2026
10.0.8 47 5/13/2026
10.0.7 42 5/4/2026
10.0.6 45 5/4/2026
10.0.5 47 3/16/2026
10.0.4 47 3/12/2026
10.0.3 50 2/12/2026
10.0.2 46 1/15/2026
10.0.1 54 12/10/2025
10.0.0 56 12/10/2025
10.0.0-rc.2.25502.107 45 12/10/2025
10.0.0-rc.1.25451.107 46 12/12/2025
10.0.0-preview.7.25380.108 41 12/12/2025
10.0.0-preview.6.25358.103 46 12/12/2025
10.0.0-preview.5.25277.114 57 12/12/2025
10.0.0-preview.4.25258.110 45 12/12/2025
10.0.0-preview.3.25171.5 41 12/12/2025
10.0.0-preview.2.25163.2 42 12/11/2025
10.0.0-preview.1.25080.5 43 12/12/2025
9.0.23 2 11/11/2026
9.0.22 15 10/28/2026
9.0.21 20 10/14/2026
9.0.20 26 9/9/2026
9.0.19 30 8/13/2026
9.0.18 30 7/18/2026
9.0.17 32 6/10/2026
9.0.16 38 5/13/2026
9.0.15 47 5/4/2026
9.0.14 44 3/12/2026
9.0.13 43 2/12/2026
9.0.12 55 1/15/2026
9.0.11 48 12/12/2025
9.0.10 42 12/12/2025
9.0.9 44 12/12/2025
9.0.8 44 12/12/2025
9.0.7 51 12/12/2025
9.0.6 52 12/12/2025
9.0.5 46 12/10/2025
9.0.4 50 12/12/2025
9.0.3 41 12/12/2025
9.0.2 48 12/12/2025
9.0.1 54 12/12/2025
9.0.0 40 12/12/2025
9.0.0-rc.2.24473.5 46 12/12/2025
9.0.0-rc.1.24431.7 40 12/12/2025
9.0.0-preview.7.24405.7 45 12/11/2025
9.0.0-preview.6.24327.7 43 12/12/2025
9.0.0-preview.5.24306.7 46 12/12/2025
9.0.0-preview.4.24266.19 35 12/12/2025
9.0.0-preview.3.24172.9 42 12/11/2025
9.0.0-preview.2.24128.5 39 12/12/2025
9.0.0-preview.1.24080.9 41 12/12/2025
8.0.1 44 12/12/2025
8.0.0 46 12/12/2025
8.0.0-rc.2.23479.6 45 12/12/2025
8.0.0-rc.1.23419.4 45 12/12/2025
8.0.0-preview.7.23375.6 41 12/12/2025
8.0.0-preview.6.23329.7 37 12/12/2025
8.0.0-preview.5.23280.8 42 12/12/2025
8.0.0-preview.4.23259.5 37 12/12/2025
8.0.0-preview.3.23174.8 47 12/12/2025
8.0.0-preview.2.23128.3 45 12/12/2025
8.0.0-preview.1.23110.8 49 12/12/2025
7.0.1 49 12/12/2025
7.0.0 40 12/12/2025
7.0.0-rc.2.22472.3 42 12/12/2025
7.0.0-rc.1.22426.10 46 12/11/2025
7.0.0-preview.7.22375.6 40 12/12/2025
7.0.0-preview.6.22324.4 41 12/12/2025
7.0.0-preview.5.22301.12 39 12/12/2025
7.0.0-preview.4.22229.4 44 12/10/2025
7.0.0-preview.3.22175.4 45 12/12/2025
7.0.0-preview.2.22152.2 40 12/12/2025
7.0.0-preview.1.22076.8 36 12/12/2025
6.0.1 44 12/12/2025
6.0.0 42 12/12/2025
6.0.0-rc.2.21480.5 37 12/12/2025
6.0.0-rc.1.21451.13 44 12/12/2025
6.0.0-preview.7.21377.19 40 12/11/2025
6.0.0-preview.6.21352.12 45 12/12/2025
6.0.0-preview.5.21301.5 43 12/12/2025
6.0.0-preview.4.21253.7 38 12/12/2025
6.0.0-preview.3.21201.4 45 12/12/2025
6.0.0-preview.2.21154.6 41 12/12/2025
6.0.0-preview.1.21102.12 45 12/12/2025
5.0.0 46 12/12/2025
5.0.0-rc.2.20475.5 45 12/11/2025
5.0.0-rc.1.20451.14 40 12/12/2025
5.0.0-preview.8.20407.11 42 12/12/2025
5.0.0-preview.7.20364.11 46 12/12/2025
5.0.0-preview.6.20305.6 47 12/12/2025
5.0.0-preview.5.20278.1 44 12/12/2025
5.0.0-preview.4.20251.6 41 12/12/2025
5.0.0-preview.3.20215.2 43 12/11/2025
5.0.0-preview.2.20160.3 41 12/12/2025
5.0.0-preview.1.20120.4 40 12/11/2025
3.1.32 47 12/12/2025
3.1.31 48 12/11/2025
3.1.30 41 12/12/2025
3.1.29 44 12/12/2025
3.1.28 53 12/12/2025
3.1.27 49 12/12/2025
3.1.26 47 12/12/2025
3.1.25 47 12/12/2025
3.1.24 46 12/11/2025
3.1.23 52 12/12/2025
3.1.22 51 12/11/2025
3.1.21 47 12/12/2025
3.1.20 49 12/12/2025
3.1.19 52 12/12/2025
3.1.18 51 12/11/2025
3.1.17 47 12/12/2025
3.1.16 44 12/12/2025
3.1.15 42 12/12/2025
3.1.14 46 12/12/2025
3.1.13 49 12/12/2025
3.1.12 43 12/12/2025
3.1.11 42 12/12/2025
3.1.10 46 12/12/2025
3.1.9 42 12/12/2025
3.1.8 50 12/12/2025
3.1.7 49 12/11/2025
3.1.6 42 12/12/2025
3.1.5 42 12/11/2025
3.1.4 45 12/11/2025
3.1.3 53 12/12/2025
3.1.2 47 12/12/2025
3.1.1 55 12/12/2025
3.1.0 47 12/12/2025
3.1.0-preview3.19553.2 41 12/12/2025
3.1.0-preview2.19525.4 46 12/12/2025
3.1.0-preview1.19506.1 48 12/12/2025
3.0.3 45 12/12/2025
3.0.2 42 12/12/2025
3.0.1 47 12/12/2025
3.0.0 51 12/12/2025
3.0.0-rc1.19456.10 44 12/11/2025
3.0.0-preview9.19423.4 38 12/11/2025
3.0.0-preview8.19405.4 44 12/12/2025
3.0.0-preview7.19362.4 41 12/11/2025
3.0.0-preview6.19304.6 45 12/12/2025
3.0.0-preview5.19227.9 45 12/12/2025
3.0.0-preview4.19216.2 53 12/12/2025
3.0.0-preview3.19153.1 41 12/11/2025
3.0.0-preview.19074.2 41 12/10/2025
3.0.0-preview.18572.1 45 12/12/2025
2.2.0 45 12/12/2025
2.2.0-preview3-35497 47 12/12/2025
2.2.0-preview2-35157 44 12/12/2025
2.2.0-preview1-35029 47 12/12/2025
2.1.1 43 12/12/2025
2.1.0 43 12/12/2025
2.1.0-rc1-final 47 12/12/2025
2.1.0-preview2-final 38 12/12/2025
2.1.0-preview1-final 43 12/12/2025