Microsoft.Extensions.Hosting 9.0.14

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
Microsoft.AspNetCore.All
25
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
26
Microsoft.AspNetCore.Mvc.Testing
Support for writing functional tests for MVC applications. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/88ca061d20b28892b28279b17bad46919cff49a4
31
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
25
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
26
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
25
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
26
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
27
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
32
Microsoft.Identity.Web
This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). This package is specifically used for web applications, which sign-in users, and protected web APIs, which optionally call downstream web APIs.
35

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 9.0

.NET Standard 2.1

.NET 8.0

Version Downloads Last updated
11.0.0-preview.2.26159.112 2 03/15/2026
11.0.0-preview.1.26104.118 4 02/12/2026
10.0.5 1 03/15/2026
10.0.4 1 03/15/2026
10.0.3 3 02/12/2026
10.0.2 6 01/18/2026
10.0.1 6 12/13/2025
10.0.0 10 11/18/2025
10.0.0-rc.2.25502.107 10 10/19/2025
10.0.0-rc.1.25451.107 9 09/16/2025
10.0.0-preview.7.25380.108 13 08/14/2025
10.0.0-preview.6.25358.103 11 07/16/2025
10.0.0-preview.5.25277.114 16 06/25/2025
10.0.0-preview.4.25258.110 14 05/14/2025
10.0.0-preview.3.25171.5 15 05/14/2025
10.0.0-preview.2.25163.2 14 03/20/2025
10.0.0-preview.1.25080.5 16 02/25/2025
9.0.14 1 03/15/2026
9.0.13 3 02/12/2026
9.0.12 6 01/18/2026
9.0.11 10 11/19/2025
9.0.10 7 10/22/2025
9.0.9 12 09/16/2025
9.0.8 16 08/10/2025
9.0.7 14 07/16/2025
9.0.6 17 06/27/2025
9.0.5 14 05/14/2025
9.0.4 19 06/06/2025
9.0.3 17 03/20/2025
9.0.2 18 02/21/2025
9.0.1 16 01/18/2025
9.0.0 17 01/18/2025
9.0.0-rc.2.24473.5 15 01/18/2025
9.0.0-rc.1.24431.7 14 10/05/2024
9.0.0-preview.7.24405.7 18 03/06/2025
9.0.0-preview.6.24327.7 16 12/22/2024
9.0.0-preview.5.24306.7 16 10/05/2024
9.0.0-preview.4.24266.19 16 02/01/2025
9.0.0-preview.3.24172.9 15 05/03/2025
9.0.0-preview.2.24128.5 13 04/14/2025
9.0.0-preview.1.24080.9 20 02/15/2024
8.0.1 21 01/18/2025
8.0.0 23 11/15/2023
8.0.0-rc.2.23479.6 17 03/04/2024
8.0.0-rc.1.23419.4 14 03/18/2024
8.0.0-preview.7.23375.6 14 03/09/2024
8.0.0-preview.6.23329.7 16 03/02/2024
8.0.0-preview.5.23280.8 14 03/04/2025
8.0.0-preview.4.23259.5 18 03/10/2024
8.0.0-preview.3.23174.8 17 10/05/2024
8.0.0-preview.2.23128.3 14 02/16/2025
8.0.0-preview.1.23110.8 11 10/05/2024
7.0.1 38 08/18/2023
7.0.0 148 08/18/2023
7.0.0-rc.2.22472.3 16 03/09/2024
7.0.0-rc.1.22426.10 16 03/09/2024
7.0.0-preview.7.22375.6 20 03/09/2024
7.0.0-preview.6.22324.4 16 03/09/2024
7.0.0-preview.5.22301.12 15 03/10/2024
7.0.0-preview.4.22229.4 13 02/16/2025
7.0.0-preview.3.22175.4 19 03/09/2024
7.0.0-preview.2.22152.2 15 03/02/2024
7.0.0-preview.1.22076.8 17 03/09/2024
6.0.2-mauipre.1.22102.15 15 03/18/2024
6.0.1 26 08/18/2023
6.0.0 22 08/18/2023
6.0.0-rc.2.21480.5 14 03/19/2024
6.0.0-rc.1.21451.13 18 03/19/2024
6.0.0-preview.7.21377.19 16 03/09/2024
6.0.0-preview.6.21352.12 15 03/14/2024
6.0.0-preview.5.21301.5 22 03/04/2024
6.0.0-preview.4.21253.7 16 03/03/2024
6.0.0-preview.3.21201.4 15 03/02/2024
6.0.0-preview.2.21154.6 14 04/08/2025
6.0.0-preview.1.21102.12 16 03/09/2024
5.0.0 25 03/06/2024
5.0.0-rc.2.20475.5 18 03/18/2024
5.0.0-rc.1.20451.14 18 03/18/2024
5.0.0-preview.8.20407.11 16 03/02/2024
5.0.0-preview.7.20364.11 15 03/02/2024
5.0.0-preview.6.20305.6 13 03/02/2024
5.0.0-preview.5.20278.1 15 03/10/2024
5.0.0-preview.4.20251.6 17 03/10/2024
5.0.0-preview.3.20215.2 16 03/02/2024
5.0.0-preview.2.20160.3 16 03/10/2024
5.0.0-preview.1.20120.4 16 03/10/2024
3.1.32 21 03/16/2024
3.1.31 18 11/15/2023
3.1.30 14 03/03/2024
3.1.29 17 03/19/2024
3.1.28 16 03/22/2024
3.1.27 15 03/05/2024
3.1.26 15 03/16/2024
3.1.25 15 03/20/2024
3.1.24 17 03/16/2024
3.1.23 19 03/18/2024
3.1.22 13 03/17/2024
3.1.21 17 03/22/2024
3.1.20 17 03/17/2024
3.1.19 16 03/19/2024
3.1.18 16 03/06/2024
3.1.17 18 03/14/2024
3.1.16 16 03/19/2024
3.1.15 15 03/14/2024
3.1.14 14 03/14/2024
3.1.13 14 03/14/2024
3.1.12 18 03/13/2024
3.1.11 18 03/13/2024
3.1.10 17 03/14/2024
3.1.9 20 03/22/2024
3.1.8 22 03/06/2024
3.1.7 21 03/19/2024
3.1.6 20 03/03/2024
3.1.5 22 03/14/2024
3.1.4 23 03/03/2024
3.1.3 18 03/04/2024
3.1.2 18 03/14/2024
3.1.1 19 03/17/2024
3.1.0 18 03/04/2024
3.1.0-preview3.19553.2 15 03/04/2024
3.1.0-preview2.19525.4 16 03/04/2024
3.1.0-preview1.19506.1 17 03/03/2024
3.0.3 18 03/14/2024
3.0.2 20 03/13/2024
3.0.1 22 03/03/2024
3.0.0 23 03/06/2024
3.0.0-rc1.19456.10 17 03/02/2024
3.0.0-preview9.19423.4 17 03/05/2024
3.0.0-preview8.19405.4 15 03/11/2024
3.0.0-preview7.19362.4 13 03/05/2024
3.0.0-preview6.19304.6 16 03/02/2024
3.0.0-preview5.19227.9 18 03/10/2024
3.0.0-preview4.19216.2 17 03/04/2024
3.0.0-preview3.19153.1 15 03/03/2024
3.0.0-preview.19074.2 15 03/02/2024
3.0.0-preview.18572.1 18 03/09/2024
2.2.0 23 03/04/2024
2.2.0-preview3-35497 16 03/04/2024
2.2.0-preview2-35157 13 03/02/2024
2.2.0-preview1-35029 16 03/04/2024
2.1.1 22 01/08/2025
2.1.0 22 03/04/2024
2.1.0-rc1-final 24 03/16/2024
2.1.0-preview2-final 16 03/09/2024
2.1.0-preview1-final 20 03/14/2024