Introducing the new IHostedLifecycleService Interface in .NET 8

Introducing the new IHostedLifecycleService Interface in .NET 8

As regular readers will be aware, an area of .NET which I follow closely is Microsoft.Extensions.Hosting. I’ve already blogged about a change in .NET 8, where new concurrency options have been introduced to support parallel running of the StartAsync and StopAsync across multiple IHostedServices. In this post, we’ll look at some new lifecycle events introduced […]

Read More

Using HostBuilder and the Generic Host in .NET Core Microservices Exploring a simple pattern for cross-cutting concerns in console based services.

NOTE: This content is now quite out of date. I have a new post “What are .NET Worker services?” which answers that question. Worker services are a much better alternative to the example below. I also cover them in detail in my new course on Pluralsight – “Building ASP.NET Core Hosted Services and .NET Core […]

Read More

Implementing IHostedService in ASP.NET Core 2.0 Use IHostedService to run background tasks in ASP.NET Core apps

NOTE: This content is now quite out of date. The implementation described below is now available in .NET Core by deriving from the BackgroundService class. I cover this topic in detail in my new course on Pluralsight – “Building ASP.NET Core Hosted Services and .NET Core Worker Services“. Update 30-08-2017: ASP.NET Core 2.0.0 is now […]

Read More