Microsoft.Extensions.Hosting 10.0.0-preview.6.25358.103

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.Azure.Functions.Worker.Core
This library provides the core functionality to build an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
10
Microsoft.Azure.Functions.Worker.Core
This library provides the core functionality to build an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
8
Microsoft.KernelMemory.Abstractions
Kernel Memory is a Copilot/Semantic Kernel Plugin and Memory Web Service to index and query any data and documents, using LLM and natural language, tracking sources and showing citations. The package contains the interfaces and models shared by all Kernel Memory packages.
8
Microsoft.Azure.Functions.Worker.Core
This library provides the core functionality to build an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
7
Microsoft.Azure.Functions.Worker
This library enables you to create an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
7
Microsoft.Azure.Functions.Worker.Grpc
This library provides gRPC support for Azure Functions .NET Worker communication with the Azure Functions Host.
7
Microsoft.Azure.WebJobs
This package contains the runtime assemblies for Microsoft.Azure.WebJobs.Host. It also adds rich diagnostics capabilities which makes it easier to monitor the WebJobs in the dashboard. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=320971
7

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-preview.6.25358.103 8 07/16/2025
9.0.7 8 07/16/2025
9.0.1 4 07/12/2025
9.0.0-preview.4.24266.19 6 07/11/2025
8.0.0 4 07/09/2025
8.0.0-preview.1.23110.8 5 07/12/2025
7.0.0-rc.2.22472.3 5 07/13/2025
7.0.0-preview.4.22229.4 4 07/12/2025
5.0.0 5 07/12/2025
5.0.0-preview.8.20407.11 6 07/12/2025
3.1.28 4 07/09/2025
3.1.25 4 07/08/2025
3.1.20 4 07/11/2025
3.1.13 6 07/12/2025
3.1.12 5 07/13/2025
3.1.9 5 07/11/2025