Open cschuchardt88 opened 5 months ago
I have started work on PR #2450 which proposes some refactoring to the Hosting library. In that PR, if you use Hosted Services for all commands the you would not need to call UseHost
anymore, and thus you could have some commands that use the IHost and some that do not.
How to do you prevent
IHost
from starting when executing a command on the command-line? It starts no matter what when usingUseHost
. What's the best way to allow allCommand
classICommandHandler
interfaces to execute without starting the middleware that runsIHostBuilder.StartAsync
? But still have all theIHost
objects; exampleIConfiguration
availableDI
in theICommandHandler
interface?Running as:
Program.cs
DefaultRootCommand.cs
Console Output