Microsoft.Extensions.Hosting 11.0.0

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.Mvc.Testing
Support for writing functional tests for MVC applications. This package was built from the source code at https://github.com/dotnet/dotnet/tree/b16286c2284fecf303dbc12a0bb152476d662e44
2,181
Aspire.Hosting.MongoDB
MongoDB support for Aspire.
72
Aspire.Hosting
Core abstractions for the Aspire application model.
69
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
66
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
64
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/ef18546e04f9b0127bbd7709b6af054cc18da98a
64
Aspire.Hosting.PostgreSQL
PostgreSQL® support for Aspire.
64
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
63
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/d9ba962869d1b1c410ea476b02de2f8e27eec762
63
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/25ef4aa38b77974263cb10f6e9cbd10135f17b59
63
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/568fff703254def7dcd35fda9892bf702d4c81d3
63
Microsoft.Extensions.Hosting.WindowsServices
.NET hosting infrastructure for Windows Services.
62
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.
62
SuperSocket.Server
SuperSocket server hosting library.
62
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/7c810658463f35c39c54d5fb8a8dbbfd463bf747
62
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/dotnet/tree/b0f34d51fccc69fd334253924abd8d6853fad7aa
62

.NET 10.0

.NET 11.0

.NET Framework 4.6.2

.NET Standard 2.0

.NET Standard 2.1

Version Downloads Last updated
11.0.0 14 11/10/2026
11.0.0-rc.3.26522.148 23 10/25/2026
11.0.0-rc.2.26504.105 30 10/13/2026
11.0.0-rc.1.26425.128 25 09/11/2026
11.0.0-preview.7.26381.103 31 08/13/2026
11.0.0-preview.6.26359.118 29 07/15/2026
11.0.0-preview.5.26302.115 34 06/10/2026
11.0.0-preview.4.26230.115 34 05/14/2026
11.0.0-preview.3.26207.106 58 04/15/2026
11.0.0-preview.2.26159.112 57 03/11/2026
11.0.0-preview.1.26104.118 69 02/11/2026
10.0.15 17 11/10/2026
10.0.14 29 10/25/2026
10.0.13 37 10/13/2026
10.0.12 32 09/09/2026
10.0.11 112 08/12/2026
10.0.10 35 07/15/2026
10.0.9 30 06/10/2026
10.0.8 35 05/14/2026
10.0.7 2,297 04/23/2026
10.0.6 38 04/15/2026
10.0.5 54 03/13/2026
10.0.4 54 03/11/2026
10.0.3 65 02/11/2026
10.0.2 65 01/13/2026
10.0.1 64 12/12/2025
10.0.0 59 12/12/2025
10.0.0-rc.2.25502.107 69 12/18/2025
10.0.0-rc.1.25451.107 62 12/20/2025
10.0.0-preview.7.25380.108 65 12/12/2025
10.0.0-preview.6.25358.103 58 12/21/2025
10.0.0-preview.5.25277.114 57 12/21/2025
10.0.0-preview.4.25258.110 48 12/13/2025
10.0.0-preview.3.25171.5 63 12/21/2025
10.0.0-preview.2.25163.2 44 12/14/2025
10.0.0-preview.1.25080.5 52 12/14/2025
9.0.23 17 11/11/2026
9.0.22 25 10/25/2026
9.0.21 27 10/13/2026
9.0.20 26 09/14/2026
9.0.19 31 08/12/2026
9.0.18 31 07/15/2026
9.0.17 29 06/10/2026
9.0.16 32 05/14/2026
9.0.15 47 04/15/2026
9.0.14 47 03/11/2026
9.0.13 53 02/11/2026
9.0.12 48 01/13/2026
9.0.11 66 12/21/2025
9.0.10 59 12/19/2025
9.0.9 51 12/27/2025
9.0.8 67 12/20/2025
9.0.7 59 12/11/2025
9.0.6 45 12/24/2025
9.0.5 61 12/13/2025
9.0.4 51 12/21/2025
9.0.3 70 12/21/2025
9.0.2 61 12/20/2025
9.0.1 19 09/29/2026
9.0.0 63 12/24/2025
9.0.0-rc.2.24473.5 60 12/14/2025
9.0.0-rc.1.24431.7 22 09/29/2026
9.0.0-preview.7.24405.7 52 12/15/2025
9.0.0-preview.6.24327.7 58 12/21/2025
9.0.0-preview.5.24306.7 63 12/12/2025
9.0.0-preview.4.24266.19 46 12/12/2025
9.0.0-preview.3.24172.9 57 12/15/2025
9.0.0-preview.2.24128.5 48 12/21/2025
9.0.0-preview.1.24080.9 24 09/28/2026
8.0.1 67 12/15/2025
8.0.0 36 09/28/2026
8.0.0-rc.2.23479.6 52 12/15/2025
8.0.0-rc.1.23419.4 64 12/14/2025
8.0.0-preview.7.23375.6 60 12/21/2025
8.0.0-preview.6.23329.7 48 12/21/2025
8.0.0-preview.5.23280.8 56 12/14/2025
8.0.0-preview.4.23259.5 56 12/15/2025
8.0.0-preview.3.23174.8 59 12/15/2025
8.0.0-preview.2.23128.3 61 12/21/2025
8.0.0-preview.1.23110.8 48 12/16/2025
7.0.1 66 12/12/2025
7.0.0 59 12/14/2025
7.0.0-rc.2.22472.3 61 12/21/2025
7.0.0-rc.1.22426.10 51 12/21/2025
7.0.0-preview.7.22375.6 63 12/21/2025
7.0.0-preview.6.22324.4 65 12/21/2025
7.0.0-preview.5.22301.12 59 12/21/2025
7.0.0-preview.4.22229.4 63 12/16/2025
7.0.0-preview.3.22175.4 58 12/15/2025
7.0.0-preview.2.22152.2 67 12/21/2025
7.0.0-preview.1.22076.8 67 12/15/2025
6.0.2-mauipre.1.22102.15 66 01/10/2026
6.0.2-mauipre.1.22054.8 47 12/25/2025
6.0.1 58 12/13/2025
6.0.0 71 12/11/2025
6.0.0-rc.2.21480.5 70 12/21/2025
6.0.0-rc.1.21451.13 57 12/21/2025
6.0.0-preview.7.21377.19 65 12/18/2025
6.0.0-preview.6.21352.12 49 12/18/2025
6.0.0-preview.5.21301.5 47 12/16/2025
6.0.0-preview.4.21253.7 55 12/16/2025
6.0.0-preview.3.21201.4 53 12/14/2025
6.0.0-preview.2.21154.6 63 12/12/2025
6.0.0-preview.1.21102.12 58 12/14/2025
5.0.0 71 12/15/2025
5.0.0-rc.2.20475.5 57 12/21/2025
5.0.0-rc.1.20451.14 68 12/21/2025
5.0.0-preview.8.20407.11 55 12/12/2025
5.0.0-preview.7.20364.11 60 12/14/2025
5.0.0-preview.6.20305.6 68 12/21/2025
5.0.0-preview.5.20278.1 42 12/14/2025
5.0.0-preview.4.20251.6 63 12/14/2025
5.0.0-preview.3.20215.2 66 12/14/2025
5.0.0-preview.2.20160.3 38 12/21/2025
5.0.0-preview.1.20120.4 66 12/14/2025
3.1.32 75 12/15/2025
3.1.31 59 12/14/2025
3.1.30 59 12/20/2025
3.1.29 65 12/21/2025
3.1.28 61 12/21/2025
3.1.27 57 12/18/2025
3.1.26 49 12/11/2025
3.1.25 60 12/21/2025
3.1.24 55 12/14/2025
3.1.23 57 12/12/2025
3.1.22 47 12/21/2025
3.1.21 58 12/21/2025
3.1.20 37 12/21/2025
3.1.19 62 12/15/2025
3.1.18 63 12/21/2025
3.1.17 70 12/14/2025
3.1.16 61 12/12/2025
3.1.15 56 12/21/2025
3.1.14 62 12/21/2025
3.1.13 65 12/13/2025
3.1.12 50 12/14/2025
3.1.11 62 12/12/2025
3.1.10 46 12/20/2025
3.1.9 65 12/14/2025
3.1.8 51 12/12/2025
3.1.7 53 12/27/2025
3.1.6 63 12/27/2025
3.1.5 70 12/27/2025
3.1.4 55 12/14/2025
3.1.3 53 12/11/2025
3.1.2 70 12/15/2025
3.1.1 65 12/19/2025
3.1.0 62 12/14/2025
3.1.0-preview3.19553.2 50 12/21/2025
3.1.0-preview2.19525.4 64 12/14/2025
3.1.0-preview1.19506.1 54 12/19/2025
3.0.3 72 12/14/2025
3.0.2 56 12/14/2025
3.0.1 58 12/27/2025
3.0.0 67 12/24/2025
3.0.0-rc1.19456.10 70 12/21/2025
3.0.0-preview9.19423.4 51 12/15/2025
3.0.0-preview8.19405.4 61 12/14/2025
3.0.0-preview7.19362.4 64 12/12/2025
3.0.0-preview6.19304.6 71 12/21/2025
3.0.0-preview5.19227.9 70 12/21/2025
3.0.0-preview4.19216.2 67 12/14/2025
3.0.0-preview3.19153.1 58 12/16/2025
3.0.0-preview.19074.2 65 12/15/2025
3.0.0-preview.18572.1 65 12/12/2025
2.2.0 58 12/14/2025
2.2.0-preview3-35497 69 12/17/2025
2.2.0-preview2-35157 52 12/12/2025
2.2.0-preview1-35029 76 12/12/2025
2.1.1 53 12/25/2025
2.1.0 57 12/14/2025
2.1.0-rc1-final 75 12/12/2025
2.1.0-preview2-final 56 12/14/2025
2.1.0-preview1-final 54 12/14/2025