Microsoft.Extensions.Hosting 10.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
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
2,833
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/954f61dd38b33caa2b736c73530bd5a294174437
745
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
93
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/432e6a061f28dda696ba16bc5442328d23b25d93
87
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
79
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/d47e49e9c1e173ac90821f7e89cc38e710274241
79
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
78
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/ae1a6cbe225b99c0bf38b7e31bf60cb653b73a52
78
Microsoft.ApplicationInsights.Kubernetes
Kubernetes support for .NET Core
77
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
77
Microsoft.AspNetCore.Mvc.Testing
Support for writing functional tests for MVC applications. This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/62c098bc170f50feca15916e81cb7f321ffc52ff
76
Microsoft.ApplicationInsights.Kubernetes
Kubernetes support for .NET Core
76
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/c911002ab43b7b989ed67090f2a48d9073d5118d
76
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/02c6de4ba6022025fcda7581415f310f8c73cdc3
75
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/bb01bbf4433e27289b99001b7de6a582879d1835
75
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
74
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
74
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/cdfa43bbe0ecc13757cc6517c9a253de77c3ec56
73
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/e77cb01b5529c137130757859f09f892dbdd2436
72
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/cccab50fba1c7335fdb48a735246374b5ddd7e69
71

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