Microsoft.Extensions.Hosting 11.0.0-preview.2.26159.112

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/b0f34d51fccc69fd334253924abd8d6853fad7aa
4
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/d3aba8fe1a0d0f5c145506f292b72ea9d28406fc
4
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/fad253f51b461736dfd3cd9c15977bb7493becef
4
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/68bb6fb08f8f85bb3cf08953a0d2f4a254eaccff
3
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/67acc3d331454956fc06d6de2218a625e3e596f8
3
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/d634f2bd1ad6e319f26ff0f1d7ada5539158a19f
3
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/1dcf7acfacf0fe154adcc23270cb0da11ff44ace
3
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
3
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/54e8b61777d42d2b10744d1987438ee5b8c0b24d
3
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
3
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/2924ca229b3d6c91b7c9eded119b31dfd7aa1fef
3
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/4e7d976438b0fc17f435804e801d5d68d193ec33
3
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/70048beee894074e9718206a0017d9b080ee66ff
3
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/8486d31e24f30e3fa1809a95699a0adc16f448d7
3
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/3fe12b935c03138f76364dc877a7e069e254b5b2
3
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/b96167fbfe8bd45d94e4dcda42c7d09eb5745459
3
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/c663adee8e64ba5d379fa0edfb8201984a7df7d0
3
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/d5dc8a13cc618b9cbdc1e5744b4806c594d49553
3
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/ed74665e773dd1ebea3289c5662d71c590305932
3
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/0a715692d8e2536c899faa0bb4f0cec2c2e33e36
3

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 11.0

.NET Standard 2.1

.NET 10.0

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