Microsoft.Extensions.Hosting 10.0.0-rc.2.25502.107

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.
76
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.
78
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.
79
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
75
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
77
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
78
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
79
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
80
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
81
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
86
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
87
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
75
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
76
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
77

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
10.0.0-rc.2.25502.107 8 10/14/2025
10.0.0-rc.1.25451.107 17 09/10/2025
10.0.0-preview.7.25380.108 19 08/14/2025
10.0.0-preview.6.25358.103 30 07/16/2025
10.0.0-preview.5.25277.114 35 06/06/2025
10.0.0-preview.4.25258.110 42 05/15/2025
10.0.0-preview.3.25171.5 46 04/11/2025
10.0.0-preview.2.25163.2 50 04/01/2025
10.0.0-preview.1.25080.5 42 04/02/2025
9.0.10 7 10/15/2025
9.0.9 15 09/10/2025
9.0.8 23 08/05/2025
9.0.7 37 07/09/2025
9.0.6 32 06/12/2025
9.0.5 38 05/16/2025
9.0.4 55 04/09/2025
9.0.3 47 04/01/2025
9.0.2 42 03/30/2025
9.0.1 48 03/31/2025
9.0.0 45 11/14/2024
9.0.0-rc.2.24473.5 48 10/22/2024
9.0.0-rc.1.24431.7 44 09/21/2024
9.0.0-preview.7.24405.7 50 08/22/2024
9.0.0-preview.6.24327.7 79 07/18/2024
9.0.0-preview.5.24306.7 67 07/18/2024
9.0.0-preview.4.24266.19 83 07/18/2024
9.0.0-preview.3.24172.9 66 07/18/2024
9.0.0-preview.2.24128.5 66 07/18/2024
9.0.0-preview.1.24080.9 68 07/18/2024
8.0.1 61 10/22/2024
8.0.0 77 04/17/2024
8.0.0-rc.2.23479.6 74 07/18/2024
8.0.0-rc.1.23419.4 75 07/18/2024
8.0.0-preview.7.23375.6 72 07/18/2024
8.0.0-preview.6.23329.7 76 07/18/2024
8.0.0-preview.5.23280.8 65 07/18/2024
8.0.0-preview.4.23259.5 71 07/18/2024
8.0.0-preview.3.23174.8 76 07/18/2024
8.0.0-preview.2.23128.3 74 07/18/2024
8.0.0-preview.1.23110.8 67 07/18/2024
7.0.1 76 07/18/2024
7.0.0 69 07/18/2024
7.0.0-rc.2.22472.3 77 07/18/2024
7.0.0-rc.1.22426.10 70 07/18/2024
7.0.0-preview.7.22375.6 56 07/18/2024
7.0.0-preview.6.22324.4 82 07/18/2024
7.0.0-preview.5.22301.12 58 07/18/2024
7.0.0-preview.4.22229.4 80 07/18/2024
7.0.0-preview.3.22175.4 69 07/18/2024
7.0.0-preview.2.22152.2 71 07/18/2024
7.0.0-preview.1.22076.8 71 07/18/2024
6.0.2-mauipre.1.22102.15 46 12/01/2024
6.0.1 70 07/18/2024
6.0.0 72 07/18/2024
6.0.0-rc.2.21480.5 70 07/18/2024
6.0.0-rc.1.21451.13 68 07/18/2024
6.0.0-preview.7.21377.19 78 07/18/2024
6.0.0-preview.6.21352.12 78 07/18/2024
6.0.0-preview.5.21301.5 70 07/18/2024
6.0.0-preview.4.21253.7 71 07/18/2024
6.0.0-preview.3.21201.4 77 07/18/2024
6.0.0-preview.2.21154.6 67 07/18/2024
6.0.0-preview.1.21102.12 70 07/18/2024
5.0.0 71 07/18/2024
5.0.0-rc.2.20475.5 72 07/18/2024
5.0.0-rc.1.20451.14 72 07/18/2024
5.0.0-preview.8.20407.11 73 07/18/2024
5.0.0-preview.7.20364.11 77 07/18/2024
5.0.0-preview.6.20305.6 69 07/18/2024
5.0.0-preview.5.20278.1 75 07/18/2024
5.0.0-preview.4.20251.6 68 07/18/2024
5.0.0-preview.3.20215.2 68 07/18/2024
5.0.0-preview.2.20160.3 66 07/18/2024
5.0.0-preview.1.20120.4 77 07/18/2024
3.1.32 68 07/18/2024
3.1.31 77 07/18/2024
3.1.30 71 07/18/2024
3.1.29 70 07/18/2024
3.1.28 79 07/18/2024
3.1.27 70 07/18/2024
3.1.26 75 07/18/2024
3.1.25 79 07/18/2024
3.1.24 68 07/18/2024
3.1.23 81 07/18/2024
3.1.22 74 07/18/2024
3.1.21 82 07/18/2024
3.1.20 82 07/18/2024
3.1.19 62 07/18/2024
3.1.18 72 07/18/2024
3.1.17 64 07/18/2024
3.1.16 80 07/18/2024
3.1.15 75 07/18/2024
3.1.14 71 07/18/2024
3.1.13 74 07/18/2024
3.1.12 69 07/18/2024
3.1.11 68 07/18/2024
3.1.10 74 07/18/2024
3.1.9 75 07/18/2024
3.1.8 68 07/18/2024
3.1.7 67 07/18/2024
3.1.6 73 07/18/2024
3.1.5 77 07/18/2024
3.1.4 69 07/18/2024
3.1.3 82 07/18/2024
3.1.2 78 07/18/2024
3.1.1 78 07/18/2024
3.1.0 81 07/18/2024
3.1.0-preview3.19553.2 74 07/18/2024
3.1.0-preview2.19525.4 69 07/18/2024
3.1.0-preview1.19506.1 75 07/18/2024
3.0.3 73 07/18/2024
3.0.2 69 07/18/2024
3.0.1 84 07/18/2024
3.0.0 67 07/18/2024
3.0.0-rc1.19456.10 65 07/18/2024
3.0.0-preview9.19423.4 67 07/18/2024
3.0.0-preview8.19405.4 69 07/18/2024
3.0.0-preview7.19362.4 71 07/18/2024
3.0.0-preview6.19304.6 73 07/18/2024
3.0.0-preview5.19227.9 68 07/18/2024
3.0.0-preview4.19216.2 76 07/18/2024
3.0.0-preview3.19153.1 66 07/18/2024
3.0.0-preview.19074.2 79 07/18/2024
3.0.0-preview.18572.1 72 07/18/2024
2.2.0 78 07/18/2024
2.2.0-preview3-35497 73 07/18/2024
2.2.0-preview2-35157 87 07/18/2024
2.2.0-preview1-35029 63 07/18/2024
2.1.1 70 07/18/2024
2.1.0 67 04/17/2024
2.1.0-rc1-final 72 07/18/2024
2.1.0-preview2-final 68 07/18/2024
2.1.0-preview1-final 62 07/18/2024