Microsoft.Extensions.Hosting 11.0.0-preview.7.26381.103

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.
152
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.
155
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.
158
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.
160
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
150
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
151
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
152
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
153
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
154
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
155
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.
162
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
151

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

.NET 10.0

.NET Standard 2.0

.NET Framework 4.6.2

.NET Standard 2.1

.NET 11.0

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