title: DI in .NET Core without ASP.NET Core
body: <p>I'm looking to write a daemon process using .NET Core which will basically act much like a cron job and just orchestrate API/DB calls on some interval. As such, it has no need to expose any web routes, so there's no need for ASP.NET Core.</p>
  
  <p>However, afaik ASP.NET Core is where you get that nice <code>Startup</code> class with all the DI plumbing and environment-based configuration you might need.</p>
  
  <p>The way I see it, I have two options:</p>
  
  <ol>
  <li>Forgo ASP.NET Core and just hook up the DI framework on my own. If I go that route, how do I do that?</li>
  <li>Include ASP.NET Core just for the DI portion, but then how do I spawn background tasks which "run forever" outside of any request context? My understanding is that the DI framework very much assumes there's some sort of incoming request to orchestrate all the injections.</li>
  </ol>