Microsoft.Extensions.Hosting 10.0.0-preview.7.25380.108

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.
61
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.
64
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.
65
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
61
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
62
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
63
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
64
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
68
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
69
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
72

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