Hosting services in .NET Core console application

Building .NET Core console applications with IHost and HostBuild to take advantage of IHostedService, graceful shutdown, dependency injection, logging, hostbuilder, configuration and more.

When building services for data processing you do not always need a user interface. An IHost is very capable of hosting such an application in a console application as headless service. The IHost does give you a number of advantages like graceful shut down, dependency injection, logging, and configuration. When running long processing tasks in Docker containers, graceful shut down helps you to keep the state of your application consistent. This post explains how making use of the generic IHost in .NET Core for headless services.

Continue reading “Hosting services in .NET Core console application”

Advertisement