Microsoft.Extensions.Hosting 10.0.12

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
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
156
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
157
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
162
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
164
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
156
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
157
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
158
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
159
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
160
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
162
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
164
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
167
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
156

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

.NET Standard 2.1

.NET 9.0

.NET 8.0

Version Downloads Last updated
11.0.0-rc.1.26425.128 3 09/10/2026
11.0.0-preview.7.26381.103 13 08/12/2026
11.0.0-preview.6.26359.118 24 07/16/2026
11.0.0-preview.5.26302.115 26 06/09/2026
11.0.0-preview.4.26230.115 29 05/13/2026
11.0.0-preview.3.26207.106 38 04/14/2026
11.0.0-preview.2.26159.112 44 03/11/2026
11.0.0-preview.1.26104.118 41 02/12/2026
10.0.12 2 09/10/2026
10.0.11 13 08/12/2026
10.0.10 21 07/16/2026
10.0.9 22 06/09/2026
10.0.8 33 05/13/2026
10.0.7 32 04/21/2026
10.0.6 29 04/14/2026
10.0.5 38 03/13/2026
10.0.4 39 03/11/2026
10.0.3 48 02/12/2026
10.0.2 52 01/13/2026
10.0.1 63 12/10/2025
10.0.0 95 11/11/2025
10.0.0-rc.2.25502.107 90 10/14/2025
10.0.0-rc.1.25451.107 100 09/10/2025
10.0.0-preview.7.25380.108 102 08/14/2025
10.0.0-preview.6.25358.103 128 07/16/2025
10.0.0-preview.5.25277.114 134 06/06/2025
10.0.0-preview.4.25258.110 112 05/15/2025
10.0.0-preview.3.25171.5 121 04/11/2025
10.0.0-preview.2.25163.2 141 04/01/2025
10.0.0-preview.1.25080.5 117 04/02/2025
9.0.20 1 09/11/2026
9.0.19 12 08/12/2026
9.0.18 18 07/16/2026
9.0.17 25 06/09/2026
9.0.16 38 05/13/2026
9.0.15 35 04/14/2026
9.0.14 39 03/11/2026
9.0.13 35 02/11/2026
9.0.12 42 01/13/2026
9.0.11 91 11/11/2025
9.0.10 94 10/15/2025
9.0.9 90 09/10/2025
9.0.8 103 08/05/2025
9.0.7 117 07/09/2025
9.0.6 122 06/12/2025
9.0.5 125 05/16/2025
9.0.4 123 04/09/2025
9.0.3 125 04/01/2025
9.0.2 119 03/30/2025
9.0.1 118 03/31/2025
9.0.0 121 11/14/2024
9.0.0-rc.2.24473.5 128 10/22/2024
9.0.0-rc.1.24431.7 115 09/21/2024
9.0.0-preview.7.24405.7 113 08/22/2024
9.0.0-preview.6.24327.7 142 07/18/2024
9.0.0-preview.5.24306.7 131 07/18/2024
9.0.0-preview.4.24266.19 165 07/18/2024
9.0.0-preview.3.24172.9 126 07/18/2024
9.0.0-preview.2.24128.5 147 07/18/2024
9.0.0-preview.1.24080.9 132 07/18/2024
8.0.1 135 10/22/2024
8.0.0 162 04/17/2024
8.0.0-rc.2.23479.6 139 07/18/2024
8.0.0-rc.1.23419.4 147 07/18/2024
8.0.0-preview.7.23375.6 138 07/18/2024
8.0.0-preview.6.23329.7 172 07/18/2024
8.0.0-preview.5.23280.8 129 07/18/2024
8.0.0-preview.4.23259.5 156 07/18/2024
8.0.0-preview.3.23174.8 147 07/18/2024
8.0.0-preview.2.23128.3 157 07/18/2024
8.0.0-preview.1.23110.8 145 07/18/2024
7.0.1 151 07/18/2024
7.0.0 134 07/18/2024
7.0.0-rc.2.22472.3 145 07/18/2024
7.0.0-rc.1.22426.10 164 07/18/2024
7.0.0-preview.7.22375.6 126 07/18/2024
7.0.0-preview.6.22324.4 140 07/18/2024
7.0.0-preview.5.22301.12 133 07/18/2024
7.0.0-preview.4.22229.4 168 07/18/2024
7.0.0-preview.3.22175.4 148 07/18/2024
7.0.0-preview.2.22152.2 156 07/18/2024
7.0.0-preview.1.22076.8 141 07/18/2024
6.0.2-mauipre.1.22102.15 129 12/01/2024
6.0.1 135 07/18/2024
6.0.0 158 07/18/2024
6.0.0-rc.2.21480.5 148 07/18/2024
6.0.0-rc.1.21451.13 138 07/18/2024
6.0.0-preview.7.21377.19 166 07/18/2024
6.0.0-preview.6.21352.12 154 07/18/2024
6.0.0-preview.5.21301.5 142 07/18/2024
6.0.0-preview.4.21253.7 150 07/18/2024
6.0.0-preview.3.21201.4 142 07/18/2024
6.0.0-preview.2.21154.6 133 07/18/2024
6.0.0-preview.1.21102.12 137 07/18/2024
5.0.0 145 07/18/2024
5.0.0-rc.2.20475.5 141 07/18/2024
5.0.0-rc.1.20451.14 156 07/18/2024
5.0.0-preview.8.20407.11 151 07/18/2024
5.0.0-preview.7.20364.11 138 07/18/2024
5.0.0-preview.6.20305.6 137 07/18/2024
5.0.0-preview.5.20278.1 151 07/18/2024
5.0.0-preview.4.20251.6 135 07/18/2024
5.0.0-preview.3.20215.2 133 07/18/2024
5.0.0-preview.2.20160.3 131 07/18/2024
5.0.0-preview.1.20120.4 153 07/18/2024
3.1.32 130 07/18/2024
3.1.31 161 07/18/2024
3.1.30 153 07/18/2024
3.1.29 147 07/18/2024
3.1.28 146 07/18/2024
3.1.27 141 07/18/2024
3.1.26 149 07/18/2024
3.1.25 156 07/18/2024
3.1.24 147 07/18/2024
3.1.23 146 07/18/2024
3.1.22 151 07/18/2024
3.1.21 151 07/18/2024
3.1.20 147 07/18/2024
3.1.19 124 07/18/2024
3.1.18 140 07/18/2024
3.1.17 136 07/18/2024
3.1.16 147 07/18/2024
3.1.15 157 07/18/2024
3.1.14 140 07/18/2024
3.1.13 142 07/18/2024
3.1.12 153 07/18/2024
3.1.11 146 07/18/2024
3.1.10 153 07/18/2024
3.1.9 146 07/18/2024
3.1.8 149 07/18/2024
3.1.7 140 07/18/2024
3.1.6 140 07/18/2024
3.1.5 152 07/18/2024
3.1.4 164 07/18/2024
3.1.3 159 07/18/2024
3.1.2 155 07/18/2024
3.1.1 154 07/18/2024
3.1.0 159 07/18/2024
3.1.0-preview3.19553.2 149 07/18/2024
3.1.0-preview2.19525.4 149 07/18/2024
3.1.0-preview1.19506.1 146 07/18/2024
3.0.3 155 07/18/2024
3.0.2 154 07/18/2024
3.0.1 153 07/18/2024
3.0.0 145 07/18/2024
3.0.0-rc1.19456.10 153 07/18/2024
3.0.0-preview9.19423.4 136 07/18/2024
3.0.0-preview8.19405.4 147 07/18/2024
3.0.0-preview7.19362.4 170 07/18/2024
3.0.0-preview6.19304.6 150 07/18/2024
3.0.0-preview5.19227.9 133 07/18/2024
3.0.0-preview4.19216.2 146 07/18/2024
3.0.0-preview3.19153.1 143 07/18/2024
3.0.0-preview.19074.2 156 07/18/2024
3.0.0-preview.18572.1 151 07/18/2024
2.2.0 156 07/18/2024
2.2.0-preview3-35497 135 07/18/2024
2.2.0-preview2-35157 157 07/18/2024
2.2.0-preview1-35029 132 07/18/2024
2.1.1 160 07/18/2024
2.1.0 160 04/17/2024
2.1.0-rc1-final 160 07/18/2024
2.1.0-preview2-final 142 07/18/2024
2.1.0-preview1-final 154 07/18/2024