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
Cocona
Micro-framework for .NET console application. Cocona makes it easy and fast to build console applications on .NET.
2,652
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
451
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
85
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
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/dotnet/aspnetcore/tree/d47e49e9c1e173ac90821f7e89cc38e710274241
76
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
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/ae1a6cbe225b99c0bf38b7e31bf60cb653b73a52
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/aspnet/AspNetCore/tree/62c098bc170f50feca15916e81cb7f321ffc52ff
74
Microsoft.ApplicationInsights.Kubernetes
Kubernetes support for .NET Core
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/02c6de4ba6022025fcda7581415f310f8c73cdc3
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/c911002ab43b7b989ed67090f2a48d9073d5118d
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/bb01bbf4433e27289b99001b7de6a582879d1835
72
Microsoft.ApplicationInsights.Kubernetes
Kubernetes support for .NET Core
71
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
71
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
70
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
70
Askmethat.Aspnet.JsonLocalizer
Json Localizer library for .NetStandard and .NetCore Asp.net projects
69
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
68
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/844a82e37cae48af2ab2ee4f39b41283e6bb4f0e
67
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
67

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