title: How to stop/exit/terminate dotnet core HostBuilder console application programmatically?
body: <p>I'm trying to create a dotnet core console app. The app is a simply utility app and should start, do its thing and exit.
  It's easy to achieve using standard console application template generated by Visual Studio.
  But these days we have HostBuilder which seems to be more attractive because it brings unifying experience with WebHostBuilder, DI, Loggin, etc.</p>
  
  <p>But it looks like this approach only designed for the long running background services. It will start and sit forever until the external termination event (like Ctrl-C).</p>
  
  <p>Is there a way to end this type of application from the inside?</p>